diff --git a/builds/php/Dockerfile b/builds/php/Dockerfile new file mode 100644 index 0000000..eb85e80 --- /dev/null +++ b/builds/php/Dockerfile @@ -0,0 +1,4 @@ +FROM php:7.4-fpm + +RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" + diff --git a/configs/nginx/nginx.conf b/configs/nginx/nginx.conf index 0590d90..a7f878d 100644 --- a/configs/nginx/nginx.conf +++ b/configs/nginx/nginx.conf @@ -35,7 +35,7 @@ server { #access_log /var/log/nginx/host.access.log main; location / { - root /var/www; + root /var/www/html; index index.html index.htm; } @@ -56,13 +56,13 @@ server { # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # - #location ~ \.php$ { - # root html; - # fastcgi_pass 127.0.0.1:9000; - # fastcgi_index index.php; - # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; - # include fastcgi_params; - #} + location ~ \.php$ { + root html; + fastcgi_pass php:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; + include fastcgi_params; + } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one diff --git a/docker-compose.yml b/docker-compose.yml index 8b7e7b2..4c73e1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,11 @@ services: - 80:80 volumes: - ./configs/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - - ./data/www:/var/www:ro + - ./data/www:/var/www/html:ro + php: + build: builds/php + volumes: + - ./data/www:/var/www/html +