rewrite
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
loglevel=info
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
childlogdir=/var/log/supervisor
|
||||
|
||||
[unix_http_server]
|
||||
file=/var/run/supervisor.sock
|
||||
chmod=0700
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///var/run/supervisor.sock
|
||||
@@ -15,26 +13,35 @@ serverurl=unix:///var/run/supervisor.sock
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[program:haproxy]
|
||||
command=/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stderr_logfile=/var/log/supervisor/haproxy.err.log
|
||||
stdout_logfile=/var/log/haproxy.log
|
||||
priority=100
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
startsecs=10
|
||||
stopwaitsecs=10
|
||||
|
||||
[program:flask_app]
|
||||
# ===== FLASK APPLICATION =====
|
||||
[program:flask]
|
||||
command=python /app/app.py
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stderr_logfile=/var/log/supervisor/flask_app.err.log
|
||||
stdout_logfile=/var/log/supervisor/flask_app.out.log
|
||||
priority=999
|
||||
environment=FLASK_APP=/app/app.py,FLASK_ENV=production,PYTHONUNBUFFERED=1
|
||||
startsecs=10
|
||||
stdout_logfile=/var/log/supervisor/flask.log
|
||||
stderr_logfile=/var/log/supervisor/flask_error.log
|
||||
stopasgroup=true
|
||||
stopsignal=TERM
|
||||
priority=999
|
||||
environment=PYTHONUNBUFFERED=1,FLASK_APP=app.py,FLASK_ENV=production
|
||||
|
||||
# ===== HAPROXY =====
|
||||
[program:haproxy]
|
||||
command=/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/haproxy.log
|
||||
stderr_logfile=/var/log/supervisor/haproxy_error.log
|
||||
stopasgroup=true
|
||||
priority=998
|
||||
|
||||
# ===== LOG ROTATION =====
|
||||
[program:logrotate]
|
||||
command=/bin/bash -c "while true; do sleep 86400; logrotate /etc/logrotate.d/haproxy 2>/dev/null || true; done"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/supervisor/logrotate.log
|
||||
stderr_logfile=/var/log/supervisor/logrotate_error.log
|
||||
stopasgroup=true
|
||||
priority=997
|
||||
|
||||
Reference in New Issue
Block a user