Initial commit
This commit is contained in:
commit
447ecdec83
|
@ -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
|
||||||
|
|
|
@ -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`
|
|
@ -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;
|
||||||
|
#}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
[program:nginx]
|
||||||
|
command=/usr/sbin/nginx
|
||||||
|
autorestart=true
|
||||||
|
|
|
@ -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
|
|
@ -0,0 +1,3 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
Loading…
Reference in New Issue