# =============================================================================
# coolcare-transition — page d'info "CoolCare a demenage"
#
# Servie sur les 5 anciens hosts *.coolcare.taaazzz-prog.fr (ceux qui n'ont
# plus de route Traefik depuis la migration DNS 2026-05-15). Detecte le
# hostname cote JS et propose le lien vers le bon subdomain coolcare.fr.
#
# Deploiement :
#   ssh ubuntu@141.94.42.172 'docker stack deploy -c /home/ubuntu/coolcare-transition-stack.yml coolcare-transition'
# =============================================================================

services:
  web:
    image: registry.taaazzz-prog.fr/taaazzz-prog/coolcare-transition:latest
    networks:
      - traefik-public
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      restart_policy:
        condition: on-failure
        delay: 5s
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        # Route HTTPS — 5 anciens hosts coolcare.taaazzz-prog.fr
        - "traefik.http.routers.coolcare-transition.rule=Host(`coolcare.taaazzz-prog.fr`) || Host(`admin.coolcare.taaazzz-prog.fr`) || Host(`tech.coolcare.taaazzz-prog.fr`) || Host(`client.coolcare.taaazzz-prog.fr`) || Host(`app.coolcare.taaazzz-prog.fr`)"
        - "traefik.http.routers.coolcare-transition.entrypoints=websecure"
        - "traefik.http.routers.coolcare-transition.tls=true"
        # certresolver letsencrypt (DNS-01 OVH) — la zone taaazzz-prog.fr
        # est dans notre compte OVH, donc DNS-01 marche pour ces hosts.
        - "traefik.http.routers.coolcare-transition.tls.certresolver=letsencrypt"
        - "traefik.http.services.coolcare-transition.loadbalancer.server.port=80"

networks:
  traefik-public:
    external: true
