Skip to content

Commit b15a580

Browse files
Rail KhamdeevRail Khamdeev
authored andcommitted
add PHP-8.4 FPM, upgrade old PHP versions
1 parent 597fc9a commit b15a580

File tree

11 files changed

+156
-20
lines changed

11 files changed

+156
-20
lines changed

.github/workflows/docker-image.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
- name: Create site.test dir and php-file
1515
run: mkdir -p projects/site.test && echo '<?php echo phpversion();' > projects/site.test/index.php
1616

17-
- name: Build the stack PHP-83 and hack with default.conf
18-
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-php-83 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp templates/docker-compose-php-83.yml docker-compose.yml && make upb
17+
- name: Build the stack PHP-84 and hack with default.conf
18+
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-php-84 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp templates/docker-compose-php-84.yml docker-compose.yml && make upb
1919

2020
- name: Test DB
2121
run: sleep 15 && docker run --network container:docker-compose-php-nginx-1 rhamdeew/telnet db 3306
@@ -35,10 +35,19 @@ jobs:
3535
run: docker compose -f docker-compose.mysqltuner.yml run --rm mysqltuner /opt/mysqltuner --help | grep 'MySQLTuner'
3636

3737
- name: Test PHP-FPM
38-
run: docker run --network container:docker-compose-php-nginx-1 rhamdeew/telnet php-83 9000
38+
run: docker run --network container:docker-compose-php-nginx-1 rhamdeew/telnet php-84 9000
3939
- name: Test Nginx localhost
40-
run: docker run --network container:docker-compose-php-nginx-1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '8.3'
40+
run: docker run --network container:docker-compose-php-nginx-1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '8.4'
41+
- name: Stop containers
42+
run: make st
43+
4144

45+
- name: Build the stack PHP-83 and hack with default.conf
46+
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-php-83 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp templates/docker-compose-php-83.yml docker-compose.yml && make upb
47+
- name: Test PHP-FPM
48+
run: docker run --network container:docker-compose-php-nginx-1 rhamdeew/telnet php-83 9000
49+
- name: Test Nginx localhost
50+
run: docker run --network container:docker-compose-php-nginx-1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '8.2'
4251
- name: Stop containers
4352
run: make st
4453

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ upb:
55
stop:
66
docker compose stop
77
st: stop
8+
@echo "🐳 Stop complete."
89
ps:
910
docker compose ps
1011

11-
#make logs name=php-83
12+
#make logs name=php-84
1213
logs:
1314
docker compose logs --tail=100 -f $(name) || true
1415
nlogs:
@@ -17,13 +18,13 @@ dblogs:
1718
docker compose logs --tail=100 -f db || true
1819

1920

20-
#make rs name=php-83
21+
#make rs name=php-84
2122
rs:
2223
docker compose restart $(name)
2324
nrs:
2425
docker compose restart nginx
2526

26-
#make exec name=php-83
27+
#make exec name=php-84
2728
exec:
2829
docker compose exec $(name) /bin/sh || true
2930
ex: exec

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
## Nginx + MariaDB + MailHog + PHP-7.4/8.0/8.1/8.2/8.3 FPM + Apache mod-php 5.6/7.4/8.1 + Nodejs 20
1+
## Nginx + MariaDB + MailHog + PHP-7.4/8.0/8.1/8.2/8.3/8.4 FPM + Apache mod-php 5.6/7.4/8.1 + Nodejs 20
22

33
![](https://github.com/rhamdeew/docker-compose-php/workflows/Docker%20Image%20CI/badge.svg)
44

55
[RU](README_ru.md)
66

77
### Supported PHP versions
88

9-
- PHP-FPM 8.3.13
10-
- PHP-FPM 8.2.25
11-
- PHP-FPM 8.1.30
9+
- PHP-FPM 8.4.6
10+
- PHP-FPM 8.3.20
11+
- PHP-FPM 8.2.28
12+
- PHP-FPM 8.1.32
1213
- PHP-FPM 8.0.30
1314
- PHP-FPM 7.4.33
14-
- Apache 2 + PHP 8.1.30
15+
- Apache 2 + PHP 8.1.32
1516
- Apache 2 + PHP 7.4.33
1617
- Apache 2 + PHP 5.6.40
1718

README_ru.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
## Nginx + MariaDB + MailHog + PHP-7.4/8.0/8.1/8.2/8.3 FPM + Apache mod-php 5.6/7.4/8.1 + Nodejs 20
1+
## Nginx + MariaDB + MailHog + PHP-7.4/8.0/8.1/8.2/8.3/8.4 FPM + Apache mod-php 5.6/7.4/8.1 + Nodejs 20
22

33
![](https://github.com/rhamdeew/docker-compose-php/workflows/Docker%20Image%20CI/badge.svg)
44

55

66
### Поддерживаемые версии PHP
77

8-
- PHP-FPM 8.3.13
9-
- PHP-FPM 8.2.25
10-
- PHP-FPM 8.1.30
8+
- PHP-FPM 8.4.6
9+
- PHP-FPM 8.3.20
10+
- PHP-FPM 8.2.28
11+
- PHP-FPM 8.1.32
1112
- PHP-FPM 8.0.30
1213
- PHP-FPM 7.4.33
13-
- Apache 2 + PHP 8.1.30
14+
- Apache 2 + PHP 8.1.32
1415
- Apache 2 + PHP 7.4.33
1516
- Apache 2 + PHP 5.6.40
1617

@@ -58,7 +59,7 @@ cp mysql.env.example mysql.env
5859
#вы можете выбрать версию PHP
5960
cp templates/docker-compose-php-81.yml docker-compose.yml
6061
61-
62+
6263
#и скопировать соответствующий конфиг для Nginx + PHP-FPM
6364
cp docker/nginx/config/templates/site.test.conf-php-81 docker/nginx/config/site.test.conf
6465
@@ -67,7 +68,7 @@ cp templates/docker-compose-apache-php-74.yml docker-compose.yml
6768
cp docker/nginx/config/templates/site.test.conf-apache-php-74 docker/nginx/config/site.test.conf
6869
cp docker/apache-php-74/config/templates/site.test.conf docker/apache-php-74/config/sites-enabled/site.test.conf
6970
70-
71+
7172
mkdir -p projects/site.test
7273
echo '<?php echo phpversion();' > projects/site.test/index.php
7374

docker/nginx/config/disabled/https_site.test.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ server {
2121
location ~ \.php$ {
2222
try_files $uri = 404;
2323
include fastcgi_params;
24-
fastcgi_pass php-83:9000;
24+
fastcgi_pass php-84:9000;
2525
# fastcgi_pass php-74:9000;
2626
# fastcgi_pass php-73:9000;
2727
# fastcgi_pass php-72:9000;
2828
# fastcgi_pass php-71:9000;
2929
# fastcgi_pass php-8:9000;
3030
# fastcgi_pass php-81:9000;
3131
# fastcgi_pass php-82:9000;
32+
# fastcgi_pass php-83:9000;
3233
fastcgi_index index.php;
3334
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3435
fastcgi_param SERVER_NAME $host;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
server {
2+
listen 80;
3+
4+
#имя сервера:
5+
server_name site.test;
6+
7+
# корневая директория
8+
root /srv/projects/site.test;
9+
include conf.d/includes/restrictions.inc;
10+
11+
satisfy any;
12+
allow 192.168.1.0/24;
13+
deny all;
14+
auth_basic "Restricted";
15+
auth_basic_user_file .htpasswd;
16+
17+
######################################
18+
# FPM config
19+
######################################
20+
location ~ \.php$ {
21+
try_files $uri = 404;
22+
include fastcgi_params;
23+
fastcgi_pass php-84:9000;
24+
fastcgi_index index.php;
25+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
26+
fastcgi_param SERVER_NAME $host;
27+
}
28+
29+
location / {
30+
index index.php index.html index.htm;
31+
try_files $uri $uri/ /index.php?$args;
32+
}
33+
34+
include conf.d/includes/assets.inc;
35+
}

docker/php-84/build/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM rhamdeew/docker-php-84-fpm-alpine
2+
#RUN usermod -u 1050 www-data && groupmod -g 1050 www-data

docker/php-84/config/msmtprc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
account mailhog
2+
host mailhog
3+
port 1025
4+
from test@test.ru

docker/php-84/config/php.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
date.timezone = "Europe/Moscow"
2+
display_errors = On
3+
sendmail_path = "/usr/bin/msmtp -a mailhog -t"
4+
5+
post_max_size = 20M
6+
upload_max_filesize=20M

docker/php-84/config/www.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[www]
2+
3+
user = www-data
4+
group = www-data
5+
6+
listen = 127.0.0.1:9000
7+
8+
pm = dynamic
9+
pm.max_children = 5
10+
pm.start_servers = 2
11+
pm.min_spare_servers = 1
12+
pm.max_spare_servers = 3

0 commit comments

Comments
 (0)