[supervisord]
nodaemon=true
user=epicrisis
logfile=/var/log/epicrisis/supervisord.log
logfile_maxbytes=0
pidfile=/var/run/epicrisis/supervisord.pid

[program:mongod]
command=/usr/bin/mongod --auth --bind_ip 127.0.0.1 --port 27017 --dbpath /data/mongodb --setParameter diagnosticDataCollectionEnabled=false
directory=/app
user=epicrisis
autostart=true
autorestart=true
startsecs=5
stopsignal=TERM
stopasgroup=true
killasgroup=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:redis]
command=/usr/bin/redis-server --bind 127.0.0.1 --port 6379 --dir /data/redis --appendonly yes --save 60 1000 --protected-mode yes
directory=/app
user=epicrisis
autostart=true
autorestart=true
startsecs=3
stopsignal=TERM
stopasgroup=true
killasgroup=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:celery]
command=/bin/bash -lc 'exec /app/.venv/bin/python -m celery -A app.batch_processing.celery_app.celery_app worker --loglevel=${CELERY_LOG_LEVEL:-INFO} -Q ${CELERY_QUEUES:-batch_jobs,individual_uploads} --concurrency=${CELERY_CONCURRENCY:-2} --hostname=epicrisis@%h'
directory=/app
user=epicrisis
autostart=true
autorestart=true
startsecs=10
stopsignal=TERM
stopasgroup=true
killasgroup=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:web]
command=/bin/bash -lc 'exec /app/.venv/bin/python -m uvicorn app.main:app --host ${APP_HOST:-0.0.0.0} --port ${APP_PORT:-7000}'
directory=/app
user=epicrisis
autostart=true
autorestart=true
startsecs=10
stopsignal=TERM
stopasgroup=true
killasgroup=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
