From 2beba6f363bd59c8289ca5648433115762c9e7e9 Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Mon, 26 Jan 2015 17:18:24 +0000 Subject: [PATCH] Fixing permissions inside container --- Dockerfile | 7 +++++-- nginx-site.conf | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e70823b..c8a3333 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get -y install nginx php5-fpm php5-mysql php-apc pwgen python-setuptools RUN apt-get -y install php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl # tweak nginx config +RUN sed -i -e"s/worker_processes 1/worker_processes 5/" /etc/nginx/nginx.conf RUN sed -i -e"s/keepalive_timeout\s*65/keepalive_timeout 2/" /etc/nginx/nginx.conf RUN sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\tclient_max_body_size 100m/" /etc/nginx/nginx.conf RUN echo "daemon off;" >> /etc/nginx/nginx.conf @@ -38,10 +39,12 @@ RUN sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" / RUN find /etc/php5/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \; # nginx site conf -ADD ./nginx-site.conf /etc/nginx/sites-available/default +RUN rm -Rf /etc/nginx/conf.d/* +ADD ./nginx-site.conf /etc/nginx/conf.d/default.conf # add test PHP file -ADD ./inde.php /usr/share/nginx/www/index.php +ADD ./index.php /usr/share/nginx/html/index.php +RUN chown -Rf nginx.nginx /usr/share/nginx/html/ # Supervisor Config RUN /usr/bin/easy_install supervisor diff --git a/nginx-site.conf b/nginx-site.conf index d38829f..5d312db 100644 --- a/nginx-site.conf +++ b/nginx-site.conf @@ -2,11 +2,11 @@ server { listen 80; ## listen for ipv4; this line is default and implied listen [::]:80 default ipv6only=on; ## listen for ipv6 - root /usr/share/nginx/www; - index index.php index.php index.html index.htm; + root /usr/share/nginx/html; + index index.php index.html index.htm; # Make site accessible from http://localhost/ - server_name localhost; + #server_name localhost; # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html sendfile off; @@ -23,7 +23,7 @@ server { # error_page 500 502 503 504 /50x.html; location = /50x.html { - root /usr/share/nginx/www; + root /usr/share/nginx/html; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000