# Configuration du superviseur sogoctl

supervisor:
  health_interval: 10s
  restart_delay: 2s
  max_restarts: 5

services:
  sogoms-db:
    binary: /opt/sogoms/bin/sogoms-db
    args:
      - "-config"
      - "/config"
      - "-socket"
      - "/run/sogoms-db.1.sock"
      - "-logs-socket"
      - "/run/sogoms-logs.1.sock"
    health_socket: /run/sogoms-db.1.sock
    depends_on:
      - sogoms-logs

  sogoms-logs:
    binary: /opt/sogoms/bin/sogoms-logs
    args:
      - "-config"
      - "/config"
      - "-socket"
      - "/run/sogoms-logs.1.sock"
      - "-logdir"
      - "/var/log/sogoms"
    health_socket: /run/sogoms-logs.1.sock

  sogoms-smtp:
    binary: /opt/sogoms/bin/sogoms-smtp
    args:
      - "-config"
      - "/config"
      - "-socket"
      - "/run/sogoms-smtp.1.sock"
      - "-logs-socket"
      - "/run/sogoms-logs.1.sock"
    health_socket: /run/sogoms-smtp.1.sock
    depends_on:
      - sogoms-logs

  sogoms-cron:
    binary: /opt/sogoms/bin/sogoms-cron
    args:
      - "-config"
      - "/config"
      - "-socket"
      - "/run/sogoms-cron.1.sock"
      - "-db-socket"
      - "/run/sogoms-db.1.sock"
      - "-smtp-socket"
      - "/run/sogoms-smtp.1.sock"
      - "-logs-socket"
      - "/run/sogoms-logs.1.sock"
    health_socket: /run/sogoms-cron.1.sock
    depends_on:
      - sogoms-db
      - sogoms-smtp
      - sogoms-logs

  sogoms-admin:
    binary: /opt/sogoms/bin/sogoms-admin
    args:
      - "-config"
      - "/config"
      - "-secrets"
      - "/secrets"
      - "-templates"
      - "/config/admin/templates"
      - "-dev"
      - "-port"
      - "9000"
      - "-db-socket"
      - "/run/sogoms-db.1.sock"
      - "-logs-socket"
      - "/run/sogoms-logs.1.sock"
      - "-cron-socket"
      - "/run/sogoms-cron.1.sock"
    health_url: http://localhost:9000/admin/login
    depends_on:
      - sogoms-db
      - sogoms-logs
      - sogoms-cron

  sogoway:
    binary: /opt/sogoms/bin/sogoway
    args:
      - "-config"
      - "/config"
      - "-port"
      - "8080"
      - "-db-socket"
      - "/run/sogoms-db.1.sock"
      - "-logs-socket"
      - "/run/sogoms-logs.1.sock"
    health_url: http://localhost:8080/health
    depends_on:
      - sogoms-db
      - sogoms-logs
