Skip to content

Commit 961d375

Browse files
Fix tests workflow
1 parent 67c53bb commit 961d375

File tree

6 files changed

+245
-159
lines changed

6 files changed

+245
-159
lines changed

.docker/config/conf.d/default.conf

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Default server definition
2+
server {
3+
listen [::]:8080 default_server;
4+
listen 8080 default_server;
5+
server_name _;
6+
7+
sendfile off;
8+
tcp_nodelay on;
9+
absolute_redirect off;
10+
11+
root /var/www/html;
12+
index index.php index.html;
13+
14+
location / {
15+
# First attempt to serve request as file, then
16+
# as directory, then fall back to index.php
17+
try_files $uri $uri/ /index.php?q=$uri&$args;
18+
}
19+
20+
# Redirect server error pages to the static page /50x.html
21+
error_page 500 502 503 504 /50x.html;
22+
location = /50x.html {
23+
root /var/lib/nginx/html;
24+
}
25+
26+
# Pass the PHP scripts to PHP-FPM listening on php-fpm.sock
27+
location ~ \.php$ {
28+
try_files $uri =404;
29+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
30+
fastcgi_pass unix:/run/php-fpm.sock;
31+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
32+
fastcgi_index index.php;
33+
include fastcgi_params;
34+
}
35+
36+
# Set the cache-control headers on assets to cache for 5 days
37+
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
38+
expires 5d;
39+
}
40+
41+
# Deny access to . files, for security
42+
location ~ /\. {
43+
log_not_found off;
44+
deny all;
45+
}
46+
47+
# Allow fpm ping and status from localhost
48+
location ~ ^/(fpm-status|fpm-ping)$ {
49+
access_log off;
50+
allow 127.0.0.1;
51+
deny all;
52+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
53+
include fastcgi_params;
54+
fastcgi_pass unix:/run/php-fpm.sock;
55+
}
56+
}

.docker/config/fpm-pool.conf

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[global]
2+
; Log to stderr
3+
error_log = /dev/stderr
4+
5+
[www]
6+
; The address on which to accept FastCGI requests.
7+
; Valid syntaxes are:
8+
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
9+
; a specific port;
10+
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
11+
; a specific port;
12+
; 'port' - to listen on a TCP socket to all addresses
13+
; (IPv6 and IPv4-mapped) on a specific port;
14+
; '/path/to/unix/socket' - to listen on a unix socket.
15+
; Note: This value is mandatory.
16+
listen = /run/php-fpm.sock
17+
18+
; Enable status page
19+
pm.status_path = /fpm-status
20+
21+
; Ondemand process manager
22+
pm = ondemand
23+
24+
; The number of child processes to be created when pm is set to 'static' and the
25+
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
26+
; This value sets the limit on the number of simultaneous requests that will be
27+
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
28+
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
29+
; CGI. The below defaults are based on a server without much resources. Don't
30+
; forget to tweak pm.* to fit your needs.
31+
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
32+
; Note: This value is mandatory.
33+
pm.max_children = 100
34+
35+
; The number of seconds after which an idle process will be killed.
36+
; Note: Used only when pm is set to 'ondemand'
37+
; Default Value: 10s
38+
pm.process_idle_timeout = 10s;
39+
40+
; The number of requests each child process should execute before respawning.
41+
; This can be useful to work around memory leaks in 3rd party libraries. For
42+
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
43+
; Default Value: 0
44+
pm.max_requests = 1000
45+
46+
; Make sure the FPM workers can reach the environment variables for configuration
47+
clear_env = no
48+
49+
; Catch output from PHP
50+
catch_workers_output = yes
51+
52+
; Remove the 'child 10 said into stderr' prefix in the log and only show the actual message
53+
decorate_workers_output = no
54+
55+
; Enable ping page to use in healthcheck
56+
ping.path = /fpm-ping

.docker/config/nginx.conf

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
worker_processes auto;
2+
error_log stderr warn;
3+
pid /run/nginx.pid;
4+
5+
events {
6+
worker_connections 1024;
7+
}
8+
9+
http {
10+
include mime.types;
11+
# Threat files with a unknown filetype as binary
12+
default_type application/octet-stream;
13+
14+
# Define custom log format to include reponse times
15+
log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" '
16+
'$status $body_bytes_sent "$http_referer" '
17+
'"$http_user_agent" "$http_x_forwarded_for" '
18+
'$request_time $upstream_response_time $pipe $upstream_cache_status';
19+
20+
access_log /dev/stdout main_timed;
21+
error_log /dev/stderr notice;
22+
23+
keepalive_timeout 65;
24+
25+
# Write temporary files to /tmp so they can be created as a non-privileged user
26+
client_body_temp_path /tmp/client_temp;
27+
proxy_temp_path /tmp/proxy_temp_path;
28+
fastcgi_temp_path /tmp/fastcgi_temp;
29+
uwsgi_temp_path /tmp/uwsgi_temp;
30+
scgi_temp_path /tmp/scgi_temp;
31+
32+
# Hide headers that identify the server to prevent information leakage
33+
proxy_hide_header X-Powered-By;
34+
fastcgi_hide_header X-Powered-By;
35+
server_tokens off;
36+
37+
# Enable gzip compression by default
38+
gzip on;
39+
gzip_proxied any;
40+
# Based on CloudFlare's recommended settings
41+
gzip_types text/richtext text/plain text/css text/x-script text/x-component text/x-java-source text/x-markdown application/javascript application/x-javascript text/javascript text/js image/x-icon image/vnd.microsoft.icon application/x-perl application/x-httpd-cgi text/xml application/xml application/rss+xml application/vnd.api+json application/x-protobuf application/json multipart/bag multipart/mixed application/xhtml+xml font/ttf font/otf font/x-woff image/svg+xml application/vnd.ms-fontobject application/ttf application/x-ttf application/otf application/x-otf application/truetype application/opentype application/x-opentype application/font-woff application/eot application/font application/font-sfnt application/wasm application/javascript-binast application/manifest+json application/ld+json application/graphql+json application/geo+json;
42+
gzip_vary on;
43+
gzip_disable "msie6";
44+
45+
# Include server configs
46+
include /etc/nginx/conf.d/*.conf;
47+
}

.docker/config/php.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Date]
2+
date.timezone="UTC"
3+
expose_php= Off

.docker/config/supervisord.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[supervisord]
2+
nodaemon=true
3+
logfile=/dev/null
4+
logfile_maxbytes=0
5+
pidfile=/run/supervisord.pid
6+
7+
[program:php-fpm]
8+
command=php-fpm83 -F
9+
stdout_logfile=/dev/stdout
10+
stdout_logfile_maxbytes=0
11+
stderr_logfile=/dev/stderr
12+
stderr_logfile_maxbytes=0
13+
autorestart=false
14+
startretries=0
15+
16+
[program:nginx]
17+
command=nginx -g 'daemon off;'
18+
stdout_logfile=/dev/stdout
19+
stdout_logfile_maxbytes=0
20+
stderr_logfile=/dev/stderr
21+
stderr_logfile_maxbytes=0
22+
autorestart=false
23+
startretries=0

0 commit comments

Comments
 (0)