Supervisor
Process Architecture
Section titled “Process Architecture”Supervisor manages all processes in the container. If any critical process exits, Supervisor can restart it automatically.
Configuration
Section titled “Configuration”[supervisord]nodaemon=trueuser=rootlogfile=/var/log/supervisor/supervisord.logpidfile=/var/run/supervisord.pid
[program:nginx]command=/usr/sbin/nginx -g 'daemon off;'autostart=trueautorestart=truepriority=10stdout_logfile=/dev/stdoutstdout_logfile_maxbytes=0stderr_logfile=/dev/stderrstderr_logfile_maxbytes=0
[program:php-fpm]command=/usr/local/sbin/php-fpm -Fautostart=trueautorestart=truepriority=5stdout_logfile=/dev/stdoutstdout_logfile_maxbytes=0stderr_logfile=/dev/stderrstderr_logfile_maxbytes=0
[program:horizon]command=/usr/bin/php /var/www/html/artisan horizonautostart=trueautorestart=trueuser=www-dataredirect_stderr=truestdout_logfile=/var/www/html/storage/logs/horizon.logstopwaitsecs=3600
[program:reverb]command=/usr/bin/php /var/www/html/artisan reverb:startautostart=trueautorestart=trueuser=www-dataredirect_stderr=truestdout_logfile=/var/www/html/storage/logs/reverb.log
[program:scheduler]command=/bin/sh -c "while [ true ]; do php /var/www/html/artisan schedule:run --verbose --no-interaction & sleep 60; done"autostart=trueautorestart=trueuser=www-dataredirect_stderr=truestdout_logfile=/var/www/html/storage/logs/scheduler.logProcess Priority
Section titled “Process Priority”| Process | Priority | Reason |
|---|---|---|
| php-fpm | 5 | Must start first |
| nginx | 10 | Depends on FPM |
| horizon | 15 | Can start after web |
| reverb | 15 | Can start after web |
| scheduler | 20 | Lowest priority |
Restart Behavior
Section titled “Restart Behavior”autorestart=true- Process restarts if it exitsstopwaitsecs=3600- Horizon gets 1 hour to finish jobs on shutdown- Logs to stdout/stderr for container log aggregation