- Variant B: docker-compose.yml gets configurable host ports and health checks. Variant A: deploy/allinone image (nginx, supervisord, gunicorn, uvicorn, gatherer, OpenVPN) with an explicit database migration step before any service; docker-compose.allinone.yml. Same five volumes and paths in both variants. - deploy/docker: install.sh, update.sh (backup, build, stop, separate DB migration phase, start, automatic rollback), backup.sh, restore.sh, lib.sh. - Verified on Docker: install A/B, update with pre-versioned databases, rollback after an injected failure, backup/restore. - Docs: Scenario1_Containers guide, change summary, README, Index; .dockerignore, .gitignore additions. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
87 lines
2.3 KiB
Plaintext
87 lines
2.3 KiB
Plaintext
; Process tree of the all-in-one container (variant A). PID 1 is supervisord (started by
|
|
; entrypoint.sh after the explicit database migration step). All logs go to the container's
|
|
; stdout/stderr (docker logs). Environment variables of the container are inherited by the programs.
|
|
|
|
[supervisord]
|
|
nodaemon=true
|
|
user=root
|
|
logfile=/dev/null
|
|
logfile_maxbytes=0
|
|
pidfile=/run/supervisord.pid
|
|
loglevel=info
|
|
|
|
[unix_http_server]
|
|
file=/run/supervisor.sock
|
|
|
|
[rpcinterface:supervisor]
|
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
|
|
|
[supervisorctl]
|
|
serverurl=unix:///run/supervisor.sock
|
|
|
|
; Start order (priority, lower first): gatherer, then the two APIs, nginx last.
|
|
; The explicit migration already ran in entrypoint.sh; the programs only check the schema
|
|
; (OVPMON_AUTO_MIGRATE=0 is exported there).
|
|
|
|
[program:gatherer]
|
|
command=python openvpn_gatherer_v3.py
|
|
directory=/app/APP_CORE
|
|
priority=10
|
|
autostart=true
|
|
autorestart=true
|
|
startsecs=5
|
|
startretries=5
|
|
stopsignal=TERM
|
|
stopwaitsecs=10
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:api]
|
|
; Flask monitoring API; "app" is the module-level Flask object of openvpn_api_v3.py
|
|
command=gunicorn -w 2 -b 127.0.0.1:5001 --access-logfile - --error-logfile - openvpn_api_v3:app
|
|
directory=/app/APP_CORE
|
|
priority=20
|
|
autostart=true
|
|
autorestart=true
|
|
startsecs=5
|
|
startretries=5
|
|
stopsignal=TERM
|
|
stopwaitsecs=15
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:profiler]
|
|
; Working directory /app on purpose: the profiler resolves easy-rsa/ and client-config/ relative
|
|
; to it, and in this layout /app/easy-rsa and /app/client-config are the volumes (as in variant B).
|
|
command=uvicorn --app-dir /app/APP_PROFILER main:app --host 127.0.0.1 --port 8000
|
|
directory=/app
|
|
priority=20
|
|
autostart=true
|
|
autorestart=true
|
|
startsecs=5
|
|
startretries=5
|
|
stopsignal=TERM
|
|
stopwaitsecs=15
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
[program:nginx]
|
|
command=nginx -g "daemon off;"
|
|
priority=30
|
|
autostart=true
|
|
autorestart=true
|
|
startsecs=3
|
|
startretries=5
|
|
stopsignal=QUIT
|
|
stopwaitsecs=10
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|