added php support

This commit is contained in:
Lulzette 2022-04-12 18:56:44 +00:00
parent 95c24321c3
commit 3427c97256
3 changed files with 18 additions and 9 deletions

4
builds/php/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM php:7.4-fpm
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

View File

@ -35,7 +35,7 @@ server {
#access_log /var/log/nginx/host.access.log main; #access_log /var/log/nginx/host.access.log main;
location / { location / {
root /var/www; root /var/www/html;
index index.html index.htm; index index.html index.htm;
} }
@ -56,13 +56,13 @@ server {
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# #
#location ~ \.php$ { location ~ \.php$ {
# root html; root html;
# fastcgi_pass 127.0.0.1:9000; fastcgi_pass php:9000;
# fastcgi_index index.php; fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name;
# include fastcgi_params; include fastcgi_params;
#} }
# deny access to .htaccess files, if Apache's document root # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one # concurs with nginx's one

View File

@ -6,6 +6,11 @@ services:
- 80:80 - 80:80
volumes: volumes:
- ./configs/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./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