1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 00:16:04 +00:00
webvirtcloud/conf/docker/supervisord.conf
catborise 80a66dc8b5 build(docker): the image is Ubuntu 26.04 with supervisord in place of phusion's runit
phusion/baseimage brought sshd, syslog-ng, my_init and runit's per
service scripts, and an nginx log forwarder tailing a file. The image
is now ubuntu:26.04 with Ubuntu's supervisor: conf/docker holds the
start script (settings, secret key, ownership, migrations as www-data),
one supervisord.conf for the six processes, nginx's config with errors
to docker logs, the backup's cron line and the health check. A stop
signals every process at once, so the worker keeps its 60 s drain
within the 95 s grace. The same volumes and container name work as
before; README runs commands with exec -u www-data in place of
/sbin/setuser. The image goes from 805 MB to 642 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
2026-11-08 16:09:21 +03:00

92 lines
2.4 KiB
Text

; The container's processes; each one's output goes to docker logs.
[supervisord]
nodaemon=true
user=root
logfile=/dev/null
logfile_maxbytes=0
pidfile=/run/supervisord.pid
[unix_http_server]
file=/run/supervisor.sock
chmod=0700
[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///run/supervisor.sock
; Every process starts again whenever it ends (startsecs=0: supervisord never
; gives up on one); the health check wants each up for 5 s.
; One group: a stop signals every process at once, so the worker has its
; whole drain time within docker's stop_grace_period (95 s).
[group:webvirtcloud]
programs=nginx,gunicorn,worker,novncd,socketiod,cron
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
stopsignal=QUIT
autorestart=true
startsecs=0
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:gunicorn]
command=/srv/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c gunicorn.conf.py
directory=/srv/webvirtcloud
user=www-data
environment=HOME="/var/www"
; gunicorn ends its requests for up to 30 s (graceful_timeout)
stopwaitsecs=35
autorestart=true
startsecs=0
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
; It drains running jobs for 60 s after TERM and exits by itself.
[program:worker]
command=/srv/webvirtcloud/venv/bin/python3 manage.py run_worker
directory=/srv/webvirtcloud
user=www-data
environment=HOME="/var/www",WEBVIRTCLOUD_LOG_FILE="/srv/webvirtcloud/data/webvirtcloud-worker.log"
stopwaitsecs=80
autorestart=true
startsecs=0
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:novncd]
command=/srv/webvirtcloud/venv/bin/python3 console/novncd
directory=/srv/webvirtcloud
user=www-data
environment=HOME="/var/www"
; a console is a child process of its own
stopasgroup=true
autorestart=true
startsecs=0
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
; The serial console; it refuses connections while SERIAL_CONSOLE_ENABLED is off.
[program:socketiod]
command=/srv/webvirtcloud/venv/bin/python3 console/socketiod
directory=/srv/webvirtcloud
user=www-data
environment=HOME="/var/www"
autorestart=true
startsecs=0
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:cron]
command=/usr/sbin/cron -f
autorestart=true
startsecs=0
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true