Antiscam / supervisord.conf
Sousaneitor30000's picture
Create supervisord.conf
43fa147 verified
# 🛡️ AntiScam AI Pro - Configuración Supervisord
# Gestión automática de procesos y reinicio en caso de fallos
[unix_http_server]
file=/tmp/supervisor.sock
chmod=0700
[supervisord]
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor
user=root
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
# Programa principal - AntiScam AI
[program:antiscam-ai]
command=python app.py
directory=/app
user=antiscam
autostart=true
autorestart=true
startsecs=10
startretries=3
redirect_stderr=true
stdout_logfile=/var/log/supervisor/antiscam-ai.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
environment=PYTHONPATH="/app",PYTHONUNBUFFERED="1"
# Worker para procesamiento de análisis (opcional)
[program:antiscam-worker]
command=python worker.py
directory=/app
user=antiscam
autostart=true
autorestart=true
startsecs=5
startretries=3
numprocs=2
process_name=%(program_name)s_%(process_num)02d
redirect_stderr=true
stdout_logfile=/var/log/supervisor/antiscam-worker.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=5
# Limpieza de archivos temporales
[program:cleanup-temp]
command=/app/scripts/cleanup_temp.sh
directory=/app
user=antiscam
autostart=true
autorestart=false
startsecs=1
startretries=1
redirect_stderr=true
stdout_logfile=/var/log/supervisor/cleanup.log
# Backup automático de base de datos
[program:db-backup]
command=/app/scripts/backup_db.sh
directory=/app
user=antiscam
autostart=false
autorestart=false
startsecs=1
startretries=1
redirect_stderr=true
stdout_logfile=/var/log/supervisor/backup.log
# Grupo de procesos
[group:antiscam]
programs=antiscam-ai,antiscam-worker
priority=999