[supervisord]
logfile=/data/log/supervisord.log
logfile_maxbytes=10MB
logfile_backups=10
loglevel=info
pidfile=/tmp/supervisord.pid
nodaemon=true
childlogdir=/data/log/

[inet_http_server]
port=127.0.0.1:9005

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=http://127.0.0.1:9005

[program:nginx]
command=nginx -c /app/deploy/nginx/nginx.conf
directory=/app/
stdout_logfile=/data/log/nginx.log
stderr_logfile=/data/log/nginx.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true

[program:gunicorn]
command=gunicorn oj.wsgi --user server --group spj --bind 127.0.0.1:8080 --workers %(ENV_MAX_WORKER_NUM)s --threads 4 --max-requests-jitter 10000 --max-requests 1000000 --keep-alive 32
directory=/app/
stdout_logfile=/data/log/gunicorn.log
stderr_logfile=/data/log/gunicorn.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true

[program:daphne]
command=daphne -b 127.0.0.1 -p 8001 --access-log /data/log/daphne_access.log oj.asgi:application
directory=/app/
user=server
stdout_logfile=/data/log/daphne.log
stderr_logfile=/data/log/daphne.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true

[program:dramatiq]
command=python3 manage.py rundramatiq --processes %(ENV_MAX_WORKER_NUM)s --threads 4
directory=/app/
user=nobody
stdout_logfile=/data/log/dramatiq.log
stderr_logfile=/data/log/dramatiq.log
autostart=true
autorestart=true
startsecs=5
stopwaitsecs = 5
killasgroup=true
