Skip to content

Commit

Permalink
Updated docker info, added config files
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Feb 2, 2016
1 parent db613ed commit a12bae2
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 15 deletions.
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM php:7.0-fpm
MAINTAINER "Zak Henry" <[email protected]>

RUN mkdir -p /data
VOLUME ["/data"]
WORKDIR /data

RUN apt-get update && \
Expand All @@ -12,7 +11,8 @@ RUN apt-get update && \
libpq-dev \
libmcrypt-dev \
libxml2-dev \
python-pip
python-pip \
nginx

RUN pip install --upgrade supervisor supervisor-stdout

Expand All @@ -25,22 +25,23 @@ RUN pecl install xdebug-beta && \
ADD config/memory.ini /opt/etc/memory.ini
ADD config/xdebug.ini /opt/etc/xdebug.ini

RUN sed -i "s|%data-root%|/data|" /opt/etc/xdebug.ini

RUN cat /opt/etc/memory.ini >> /usr/local/etc/php/conf.d/memory.ini


# Configure nginx
ADD config/nginx.conf /etc/nginx/nginx.conf

# Add supervisor config file
ADD config/supervisord.conf /etc/supervisor/supervisord.conf


# Startup scripts
# supervisord startup script
ADD config/supervisord-start.sh /opt/bin/supervisord-start.sh
RUN chmod u=rwx /opt/bin/supervisord-start.sh
# Nginx startup script
ADD config/nginx-start.sh /opt/bin/nginx-start.sh
RUN chmod u=rwx /opt/bin/nginx-start.sh
# PHP startup script
ADD config/webserver-start.sh /opt/bin/webserver-start.sh
RUN chmod u=rwx /opt/bin/webserver-start.sh

EXPOSE 80
ADD config/php-start.sh /opt/bin/php-start.sh
RUN chmod u=rwx /opt/bin/php-start.sh

ENTRYPOINT ["/opt/bin/webserver-start.sh"]
ENTRYPOINT ["/opt/bin/supervisord-start.sh"]
3 changes: 2 additions & 1 deletion config/nginx-start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
NGINX_VHOSTS=${NGINX_VHOSTS:-/data/vhosts}

cp ${DATA_ROOT}/${NGINX_VHOSTS} /etc/nginx/sites-available/
rm /etc/nginx/sites-available/* /etc/nginx/sites-enabled/*
cp $NGINX_VHOSTS /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/*.conf /etc/nginx/sites-enabled/

#iterate though all the env vars and replace %ENV% with the value
Expand Down
79 changes: 79 additions & 0 deletions config/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
user www-data;
worker_processes 4;
pid /run/nginx.pid;
daemon off;

events {
worker_connections 768;
# multi_accept on;
}

http {

upstream fastgci_backend {
server localhost:9000;
}

##
# Basic Settings
##

sendfile off;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;


# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# Logging Settings
##

access_log /var/log/access.log;
error_log /var/log/error.log warn;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##

#include /etc/nginx/naxsi_core.rules;

##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##

#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
File renamed without changes.
2 changes: 1 addition & 1 deletion config/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stdout_events_enabled = true
stderr_events_enabled = true

[program:fpm]
command = php-fpm
command = /opt/bin/php-start.sh
process_name = %(program_name)s_%(process_num)02d
autostart = true
autorestart = true
Expand Down
4 changes: 2 additions & 2 deletions config/xdebug.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

[xdebug]
xdebug.enable=1
xdebug.enable = 1
xdebug.remote_enable = 1
xdebug.remote_port = 9001
xdebug.profiler_enable = 0
xdebug.remote_connect_back = 1
xdebug.idekey = "PHPSTORM"
xdebug.remote_log = %data-root%/logs/xdebug.log
xdebug.remote_log = /var/log/xdebug.log

0 comments on commit a12bae2

Please sign in to comment.