selfhost/supervisord.conf
Rama main · réplica de lectura del repositorio original.
[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
[program:caddy]
command=/usr/bin/caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true
startsecs=2
startretries=3
priority=30
[program:backend]
command=/app/backend/app
directory=/app/backend
environment=SERVER_PORT="3001",SERVER_HOST="127.0.0.1"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true
startsecs=5
startretries=3
priority=20
[program:dashboard]
command=node /app/dashboard/server.js
directory=/app/dashboard
environment=NODE_ENV="production",HOSTNAME="0.0.0.0",PORT="3000"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true
startsecs=5
startretries=3
priority=20
; Stops supervisord (PID 1), and with it the container, when any program goes FATAL.
; stdout carries the event protocol (READY/RESULT), so the log line goes to stderr.
; supervisord expands % in values and strips " ;" / " #" as comments: keep both out of the command.
[eventlistener:fatalexit]
command=/bin/bash -c '
while :; do
printf "READY\n"
IFS= read -r header || exit 1
payload=$(dd bs=1 count="${header##*len:}" 2>/dev/null)
program=${payload#processname:}
echo "betterlytics: ${program/ */} failed to start and supervisord gave up; stopping the container. Check docker compose logs betterlytics-selfhost for the cause." >&2
kill -TERM 1
printf "RESULT 2\nOK"
done'
events=PROCESS_STATE_FATAL
autostart=true
autorestart=unexpected
startsecs=0
priority=1
stdout_logfile=NONE
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0