[supervisord] nodaemon=true user=root logfile=/var/log/supervisor/supervisord.log pidfile=/var/run/supervisord.pid # 1. PostgreSQL - PRIORITÉ 1 (démarre en premier) [program:postgresql] command=/usr/lib/postgresql/18/bin/postgres -D /var/lib/postgresql/18/main user=postgres autostart=true autorestart=true priority=1 stdout_logfile=/var/log/postgresql/postgresql.log stderr_logfile=/var/log/postgresql/postgresql-error.log startsecs=5 stopwaitsecs=30 # 2. Init Database - PRIORITÉ 5 (après PostgreSQL) [program:init-database] command=/usr/local/bin/init-database.sh autostart=true autorestart=false startsecs=0 priority=5 stdout_logfile=/var/log/postgresql/init-database.log stderr_logfile=/var/log/postgresql/init-database-error.log # 4. Tomcat - PRIORITÉ 15 (après init-database + délai) [program:tomcat] command=/bin/bash -c 'sleep 20 && /opt/tomcat/bin/catalina.sh run' autostart=true autorestart=true priority=15 stdout_logfile=/opt/tomcat/logs/catalina.out stderr_logfile=/opt/tomcat/logs/catalina.out environment=JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64",CATALINA_HOME="/opt/tomcat" startsecs=35 stopwaitsecs=30 # 3. Apache - PRIORITÉ 10 [program:apache2] command=/usr/sbin/apache2ctl -D FOREGROUND autostart=true autorestart=true priority=10 stdout_logfile=/var/log/apache2/access.log stderr_logfile=/var/log/apache2/error.log startsecs=5 # 5. Node Exporter - PRIORITÉ 20 [program:node_exporter] command=/usr/local/bin/node_exporter autostart=true autorestart=true priority=20 stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 startsecs=5 # 6. Apache Exporter - PRIORITÉ 20 [program:apache_exporter] command=/usr/local/bin/apache_exporter --scrape_uri=http://localhost/server-status?auto autostart=true autorestart=true priority=20 stdout_logfile=/var/log/apache_exporter.log stderr_logfile=/var/log/apache_exporter_error.log startsecs=5 # 7. Promtail - PRIORITÉ 25 [program:promtail] command=/usr/local/bin/promtail -config.file=/etc/promtail/config.yaml autostart=true autorestart=true priority=25 stdout_logfile=/var/log/promtail/promtail.log stderr_logfile=/var/log/promtail/promtail_error.log startsecs=5