diff --git a/Dockerfile b/Dockerfile index 9557eafa..b138fdca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ENV DB_DRIVER=mysql \ COPY . /var/www/html/ WORKDIR /var/www/html/ -#using nodesource and debian jessie packages instead of compiling from scratch +# Using nodesource and debian jessie packages instead of compiling from scratch RUN DEBIAN_FRONTEND=noninteractive \ echo "APT::Install-Recommends \"0\";" >> /etc/apt/apt.conf.d/02recommends && \ echo "APT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/02recommends && \ @@ -28,11 +28,11 @@ RUN DEBIAN_FRONTEND=noninteractive \ rm -r /var/lib/apt/lists/* && \ chown -R www-data /var/www/html -# ensure the assets have been compiled +# Ensure the assets have been compiled RUN for d in public/{build,css,js} ; do test ! -d public/build && \ echo "Run 'gulp' before building container" >&2 && exit 1 || : ; done -# hardcode the Illuminate key in app/config/app.php. If you want security, feel free +# Hardcode the Illuminate key in app/config/app.php. If you want security, feel free # to override the key in your own container with a 'php artisan key:generate' :) RUN sed -i "s/'key' => '\w.*/'key' => 'f20d3e5ae02125a94bd60203a4edfbde',/" app/config/app.php && \ grep key app/config/app.php diff --git a/nginx-site.conf b/nginx-site.conf index c0a8b9f4..e9610b17 100644 --- a/nginx-site.conf +++ b/nginx-site.conf @@ -1,28 +1,30 @@ server { - listen 8000 default; ## listen for ipv4; this line is default and implied + listen 8000 default; ## Listen for ipv4; this line is default and implied + + # Make site accessible from http://localhost/ + server_name localhost; + root /var/www/html/public; + index index.html index.htm index.php; - root /var/www/html/public; - index index.php; + charset utf-8; - # Make site accessible from http://localhost/ - server_name localhost; + location / { + try_files $uri $uri/ /index.php?$query_string; + } - location / { - try_files $uri /index.php$is_args$args; - } - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - # - location ~ \.php$ { - - include fastcgi_params; - fastcgi_pass 127.0.0.1:9000; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_index index.php; - fastcgi_keep_conn on; - - } + # Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_index index.php; + fastcgi_keep_conn on; + } + location ~ /\.ht { + deny all; + } } diff --git a/php-fpm-pool.conf b/php-fpm-pool.conf index ba5d3abf..e946bf00 100644 --- a/php-fpm-pool.conf +++ b/php-fpm-pool.conf @@ -1,5 +1,4 @@ [www] - user = www-data group = www-data @@ -22,5 +21,4 @@ env[DB_PASSWORD] = $DB_PASSWORD [global] - daemonize = no