-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker configuration. Thanks to Jesús Manuel Vargas, I have reworked his stack https://github.com/jmvargas/docker-compose-php-stack
- Loading branch information
1 parent
28fbc6f
commit adef51c
Showing
8 changed files
with
109 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/vendor/ | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
yarn-error.log | ||
/log/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '2' | ||
services: | ||
# PHP | ||
phpfpm: | ||
restart: always | ||
build: php-fpm | ||
volumes: | ||
- ./php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf | ||
- ./php-fpm/php.ini:/usr/local/etc/php/php.ini | ||
- ./src:/var/www/html | ||
- ./log/php-fpm:/var/log/php-fpm | ||
|
||
# Nginx | ||
nginx: | ||
restart: always | ||
image: nginx:1-alpine | ||
ports: | ||
- "80:80" | ||
links: | ||
- phpfpm:phpfpm | ||
volumes: | ||
- ./nginx/vhost.conf:/etc/nginx/conf.d/default.conf | ||
- ./src:/var/www/html | ||
- ./log/nginx:/var/log/nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
server { | ||
listen 0.0.0.0:80; | ||
server_name localhost; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
root /var/www/html/; | ||
|
||
location / { | ||
index index.php; | ||
} | ||
|
||
location ~ \.php$ { | ||
fastcgi_pass phpfpm:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include /etc/nginx/fastcgi_params; | ||
} | ||
|
||
location /php/fpm/status { | ||
fastcgi_pass phpfpm:9000; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include /etc/nginx/fastcgi_params; | ||
} | ||
|
||
location /php/fpm/ping { | ||
fastcgi_pass phpfpm:9000; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include /etc/nginx/fastcgi_params; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM php:8.1-fpm | ||
|
||
CMD ["php-fpm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[global] | ||
|
||
error_log = /var/log/php-fpm/fpm-error.log | ||
daemonize = no | ||
|
||
[www] | ||
|
||
user = www-data | ||
group = www-data | ||
|
||
listen = [::]:9000 | ||
|
||
pm = dynamic | ||
pm.max_children = 5 | ||
pm.start_servers = 2 | ||
pm.min_spare_servers = 1 | ||
pm.max_spare_servers = 3 | ||
pm.status_path = /php/fpm/status | ||
|
||
clear_env = no | ||
|
||
access.log = /var/log/php-fpm/access.log | ||
access.format = "%t \"%m %r%Q%q\" %s %{mili}dms %{kilo}Mkb %C%%" | ||
catch_workers_output = yes | ||
|
||
php_flag[display_errors] = on | ||
;php_admin_flag[log_errors] = true | ||
php_admin_value[date.timezone] = "Europe/Rome" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Date] | ||
date.timezone = "Europe/Rome" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
echo "Hello world!"; |