Skip to content

Commit dff9ba1

Browse files
committed
example dhi
example config with DHI for WSC
1 parent a9429a5 commit dff9ba1

File tree

5 files changed

+72
-29
lines changed

5 files changed

+72
-29
lines changed

examples/fpm-nginx-dhi/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# General
22
DOMAIN=example.com
3-
PHP_VERSION=8.4
43
# Database (MySQL/MariaDB)
54
MYSQL_ROOT_PASSWORD=my-secret-pw
65
MYSQL_DATABASE=woltlab_suite

examples/fpm-nginx-dhi/config/nginx_default.conf

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,71 @@ server {
88
listen 8080;
99
listen [::]:8080;
1010
server_name _;
11-
11+
1212
# disable any limits to avoid HTTP 413 for large image uploads
1313
client_max_body_size 0;
1414

15-
# nginx status
16-
location /nginx_status {
17-
stub_status on;
18-
access_log off;
19-
allow 127.0.0.1;
20-
allow 10.0.0.0/8;
21-
allow 172.16.0.0/12;
22-
allow 192.168.0.0/16;
23-
allow ::1;
24-
allow fd00::/8;
25-
deny all;
26-
}
27-
2815
# Error Page
2916
location @error_page {
3017
add_header Content-Type text/plain;
31-
return 200 'Website is in maintenance mode!)';
18+
return 200 'Maintenance mode!';
3219
}
33-
20+
3421
root /var/www/html;
3522
index index.php index.html test.php;
36-
23+
3724
location / {
3825
#root /var/www/html;
3926
#index index.php index.html;
40-
27+
4128
try_files $uri $uri/ /index.php?$query_string;
4229
}
43-
30+
4431
location ~ \.php$ {
4532
#root /var/www/html;
46-
33+
4734
try_files $uri =404;
48-
49-
fastcgi_pass wsc-dhi-php:9000;
35+
36+
fastcgi_pass wsc-php:9000;
5037
fastcgi_index index.php;
5138
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
5239
include fastcgi_params;
53-
40+
5441
# Error Page (redirect)
5542
error_page 502 503 504 = @error_page;
5643
}
57-
44+
45+
# nginx status
46+
location /nginx_status {
47+
stub_status on;
48+
access_log off;
49+
allow 127.0.0.1;
50+
allow 10.0.0.0/8;
51+
allow 172.16.0.0/12;
52+
allow 192.168.0.0/16;
53+
allow ::1;
54+
allow fd00::/8;
55+
deny all;
56+
}
57+
58+
# php-fpm status/ping
59+
location ~ ^/(php_fpm_status|php_fpm_ping)$ {
60+
fastcgi_pass wsc-php:9001;
61+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
62+
include fastcgi_params;
63+
access_log off;
64+
allow 127.0.0.1;
65+
allow 10.0.0.0/8;
66+
allow 172.16.0.0/12;
67+
allow 192.168.0.0/16;
68+
allow ::1;
69+
allow fd00::/8;
70+
deny all;
71+
72+
# Error Page (redirect)
73+
error_page 502 503 504 = @error_page;
74+
}
75+
5876
location ~ /\.ht {
5977
deny all;
6078
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[www]
2+
; status page (example: http://localhost:9001/php_fpm_status?json&full)
3+
pm.status_path = /php_fpm_status
4+
pm.status_listen = 9001
5+
; ping (healtcheck)
6+
ping.path = /php_fpm_ping
7+
;ping.response = pong
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[PHP]
2+
date.timezone=Europe/Berlin
3+
display_errors = On
4+
memory_limit = 256M
5+
post_max_size = 250M
6+
upload_max_filesize = 250M
7+
max_file_uploads = 20
8+
max_execution_time = 120
9+
10+
; https://www.php.net/manual/en/opcache.configuration.php
11+
[opcache]
12+
opcache.enable=1
13+
opcache.memory_consumption=192
14+
opcache.interned_strings_buffer=16
15+
opcache.max_accelerated_files=10000
16+
opcache.max_wasted_percentage=10
17+
opcache.validate_timestamps=1
18+
opcache.revalidate_freq=2
19+
opcache.save_comments=1

examples/fpm-nginx-dhi/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ services:
44
# based on: https://dhi.io/catalog/php
55
# command: mkdir ./html && chown 65532:65532 ./html
66
wsc-php:
7-
image: docker.io/tobi312/php:${PHP_VERSION:-8.4}-dhi-fpm-debian-wsc
8-
#image: docker.io/tobi312/php:${PHP_VERSION:-8.4}-dhi-fpm-alpine-wsc
7+
image: docker.io/tobi312/php:8.4-dhi-fpm-debian-wsc
8+
#image: docker.io/tobi312/php:8.4-dhi-fpm-alpine-wsc
99
container_name: wsc-php
1010
restart: unless-stopped
1111
volumes:
1212
- ./html:/var/www/html:rw
13-
#- ./config/php_wsc.ini:/opt/php-${PHP_VERSION:-8.4}/etc/php/conf.d/wsc.ini:ro
14-
#- ./config/php_fpm_status.ini:/opt/php-${PHP_VERSION:-8.4}/etc/php-fpm.d/status.ini:ro
13+
- ./config/php_wsc.ini:/opt/php/etc/php/conf.d/wsc.ini:ro
14+
- ./config/php_fpm_status.conf:/opt/php/etc/php-fpm.d/y-status.conf:ro
1515
#depends_on:
1616
# wsc-db:
1717
# condition: service_started

0 commit comments

Comments
 (0)