[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:backend]
command=uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
directory=/app
user=app
autostart=true
autorestart=true
stdout_logfile=/var/log/pharmacopoeia/backend.log
stderr_logfile=/var/log/pharmacopoeia/backend-error.log
environment=
    DATABASE_URL="%(ENV_DATABASE_URL)s",
    REDIS_HOST="%(ENV_REDIS_HOST)s",
    MILVUS_HOST="%(ENV_MILVUS_HOST)s"

[program:celery-worker]
command=celery -A app.tasks worker --loglevel=info --concurrency=4
directory=/app
user=app
autostart=true
autorestart=true
stdout_logfile=/var/log/pharmacopoeia/celery-worker.log

[program:celery-beat]
command=celery -A app.tasks beat --loglevel=info
directory=/app
user=app
autostart=true
autorestart=true
stdout_logfile=/var/log/pharmacopoeia/celery-beat.log

[group:pharmacopoeia]
programs=backend,celery-worker,celery-beat
priority=999
