From 447ecdec837443bf63041a8c0465adfc75e229cb Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 14 Aug 2016 22:27:49 -0700 Subject: [PATCH] Initial commit --- Dockerfile | 22 +++++++++++++++++++++ README.md | 7 +++++++ default | 44 ++++++++++++++++++++++++++++++++++++++++++ info.php | 1 + supervisor-nginx.conf | 4 ++++ supervisor-phpfpm.conf | 3 +++ supervisor.conf | 3 +++ 7 files changed, 84 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 default create mode 100644 info.php create mode 100644 supervisor-nginx.conf create mode 100644 supervisor-phpfpm.conf create mode 100644 supervisor.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0b6d8f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:trusty + +RUN apt-get update && \ + apt-get install -y nginx-light supervisor && \ + apt-get install -y php5-fpm php5-cgi php5-cli php5-curl php5-gd php5-json php5-ldap php5-mysql php5-odbc php5-pgsql php5-readline php5-sqlite php5-tidy php5-xmlrpc php5-geoip php5-imagick php5-imap php5-mcrypt php5-memcache php5-memcached php5-ming php5-mongo php5-oauth php5-redis php5-sasl && \ + rm -rf /var/lib/apt/lists/* /usr/share/nginx/html/index.html && \ + echo 'daemon off;' >> /etc/nginx/nginx.conf + +# Supervisor confs +ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf +ADD supervisor-nginx.conf /etc/supervisor/conf.d/nginx.conf +ADD supervisor-phpfpm.conf /etc/supervisor/conf.d/phpfpm.conf +ADD default /etc/nginx/sites-enabled/default +ADD info.php /usr/share/nginx/html/index.php + +# Startup tasks + +ENTRYPOINT ["supervisord"] + +EXPOSE 80 +EXPOSE 443 + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e03a637 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +Probably run it like: + +`docker run -p 80:80 -v /host/phpdocroot:/usr/share/nginx/html/ dpedu/nginxfpm` + +And optionally: + +`-v /host/nginx_site_config:/etc/nginx/sites-enabled/default` diff --git a/default b/default new file mode 100644 index 0000000..aea4645 --- /dev/null +++ b/default @@ -0,0 +1,44 @@ +server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; + + root /usr/share/nginx/html; + index index.html index.htm index.php; + + # Make site accessible from http://localhost/ + # server_name localhost; + + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + # Uncomment to enable naxsi on this location + # include /etc/nginx/naxsi.rules + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + #error_page 500 502 503 504 /50x.html; + #location = /50x.html { + # root /usr/share/nginx/html; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + location ~ \.php$ { + try_files $uri =404; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} \ No newline at end of file diff --git a/info.php b/info.php new file mode 100644 index 0000000..147cebc --- /dev/null +++ b/info.php @@ -0,0 +1 @@ + diff --git a/supervisor-nginx.conf b/supervisor-nginx.conf new file mode 100644 index 0000000..eb73b43 --- /dev/null +++ b/supervisor-nginx.conf @@ -0,0 +1,4 @@ +[program:nginx] +command=/usr/sbin/nginx +autorestart=true + diff --git a/supervisor-phpfpm.conf b/supervisor-phpfpm.conf new file mode 100644 index 0000000..f3dc409 --- /dev/null +++ b/supervisor-phpfpm.conf @@ -0,0 +1,3 @@ +[program:phpfpm] +command=/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/php-fpm.conf -c /etc/php5/fpm/ --nodaemonize +autorestart=true diff --git a/supervisor.conf b/supervisor.conf new file mode 100644 index 0000000..3fb016d --- /dev/null +++ b/supervisor.conf @@ -0,0 +1,3 @@ +[supervisord] +nodaemon=true +