services:
  dashboard:
    build:
      context: ./src
      dockerfile: Dockerfile
    container_name: manus-dashboard
    restart: unless-stopped
    privileged: true
    env_file:
      - .env
    environment:
      - NODE_ENV=production
      - PORT=3001
      - JWT_SECRET=${DASHBOARD_JWT_SECRET}
      - ADMIN_USERNAME=${DASHBOARD_ADMIN_USERNAME}
      - ADMIN_PASSWORD=${DASHBOARD_ADMIN_PASSWORD}
      - GITEA_URL=${GITEA_URL}
      - GITEA_USERNAME=${GITEA_USERNAME}
      - GITEA_PASSWORD=${GITEA_PASSWORD}
      - WEBHOOK_SECRET=${WEBHOOK_SECRET}
      - APPS_BASE_PATH=${APPS_BASE_PATH}
      - INFRA_BASE_PATH=${INFRA_BASE_PATH}
      - HEALTH_CHECK_INTERVAL=${HEALTH_CHECK_INTERVAL}
    volumes:
      - /opt/manus-deploy/webhook-patched.js:/app/backend/src/webhook.js:ro
      - /var/run/docker.sock:/var/run/docker.sock
      - /opt/manus-deploy:/opt/manus-deploy
    networks:
      - web
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.manus-dashboard.rule=Host(`dashboard.recette.santinova-soft.org`)"
      - "traefik.http.routers.manus-dashboard.entrypoints=websecure"
      - "traefik.http.routers.manus-dashboard.tls=true"
      - "traefik.http.routers.manus-dashboard.tls.certresolver=letsencrypt"
      - "traefik.http.routers.manus-dashboard.service=manus-dashboard-svc"
      - "traefik.http.routers.manus-dashboard.priority=100"
      - "traefik.http.services.manus-dashboard-svc.loadbalancer.server.port=3001"
      - "traefik.docker.network=web"
networks:
  web:
    external: true
