feat(docker): add supervisord, PHP and FPM configs
This commit is contained in:
parent
28b2c61e36
commit
d4abc61f24
|
|
@ -1,5 +1,7 @@
|
||||||
|
; FPM worker error logging to stderr (Docker logs)
|
||||||
|
|
||||||
[www]
|
[www]
|
||||||
catch_workers_output = yes
|
catch_workers_output = yes
|
||||||
decorate_workers_output = no
|
decorate_workers_output = no
|
||||||
php_admin_flag[log_errors] = on
|
php_admin_flag[log_errors] = on
|
||||||
php_admin_value[error_log] = /proc/self/fd/2
|
php_admin_value[error_log] = /dev/stderr
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
[www]
|
|
||||||
ping.path = /ping
|
|
||||||
ping.response = pong
|
|
||||||
28
build/fpm-pool.conf
Normal file
28
build/fpm-pool.conf
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
; PHP-FPM pool configuration for Laravel
|
||||||
|
|
||||||
|
[www]
|
||||||
|
user = www-data
|
||||||
|
group = www-data
|
||||||
|
|
||||||
|
; Listen on TCP (needed for Docker networking with Caddy)
|
||||||
|
listen = 9000
|
||||||
|
listen.owner = www-data
|
||||||
|
listen.group = www-data
|
||||||
|
|
||||||
|
; Process management
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 10
|
||||||
|
pm.start_servers = 2
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
pm.max_spare_servers = 3
|
||||||
|
pm.max_requests = 500
|
||||||
|
|
||||||
|
; Healthcheck ping endpoint
|
||||||
|
ping.path = /ping
|
||||||
|
ping.response = pong
|
||||||
|
|
||||||
|
; Pass environment variables from Docker into PHP
|
||||||
|
clear_env = no
|
||||||
|
|
||||||
|
; Access log to /dev/null (access logs bloat container logs)
|
||||||
|
access.log = /dev/null
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
log_errors = On
|
|
||||||
error_log = /proc/self/fd/2
|
|
||||||
error_reporting = E_ALL
|
|
||||||
display_errors = Off
|
|
||||||
display_startup_errors = On
|
|
||||||
23
build/php.ini
Normal file
23
build/php.ini
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
; Production PHP configuration for Laravel Docker deployment
|
||||||
|
|
||||||
|
; Upload limits (matches UPLOAD_MAX_FILE_SIZE in .env = 100MB)
|
||||||
|
upload_max_filesize = 100M
|
||||||
|
post_max_size = 110M
|
||||||
|
|
||||||
|
; Memory and execution
|
||||||
|
memory_limit = 256M
|
||||||
|
max_execution_time = 300
|
||||||
|
max_input_time = 300
|
||||||
|
|
||||||
|
; Error logging (logs to stderr → Docker logs)
|
||||||
|
log_errors = On
|
||||||
|
error_log = /dev/stderr
|
||||||
|
error_reporting = E_ALL
|
||||||
|
display_errors = Off
|
||||||
|
display_startup_errors = Off
|
||||||
|
|
||||||
|
; Timezone
|
||||||
|
date.timezone = Europe/Berlin
|
||||||
|
|
||||||
|
; File uploads temp dir
|
||||||
|
upload_tmp_dir = /tmp
|
||||||
54
build/supervisord.conf
Normal file
54
build/supervisord.conf
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/dev/null
|
||||||
|
logfile_maxbytes=0
|
||||||
|
pidfile=/var/run/supervisord.pid
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///var/run/supervisor.sock
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/var/run/supervisor.sock
|
||||||
|
chmod=0700
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[program:php-fpm]
|
||||||
|
command=php-fpm --nodaemonize
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=10
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
stdout_events_enabled=true
|
||||||
|
stderr_events_enabled=true
|
||||||
|
|
||||||
|
[program:laravel-worker]
|
||||||
|
command=php /app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
user=www-data
|
||||||
|
priority=20
|
||||||
|
numprocs=1
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
stdout_events_enabled=true
|
||||||
|
stderr_events_enabled=true
|
||||||
|
|
||||||
|
[program:laravel-scheduler]
|
||||||
|
command=php /app/artisan schedule:work
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
user=www-data
|
||||||
|
priority=20
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
stdout_events_enabled=true
|
||||||
|
stderr_events_enabled=true
|
||||||
Loading…
Reference in a new issue