services:
  bm-web:
    image: nginx:alpine
    container_name: bm-web
    networks:
      - stack-vps_admin
    volumes:
      - ./site:/usr/share/nginx/html:ro
    labels:
      - traefik.enable=true
      - traefik.docker.network=stack-vps_admin

      # ✅ règle de matching (OBLIGATOIRE)
      - traefik.http.routers.bm-web.rule=Host(`metalfrom.eu`) || Host(`www.metalfrom.eu`)

      - traefik.http.routers.bm-web.entrypoints=websecure
      - traefik.http.routers.bm-web.tls=true
      - traefik.http.routers.bm-web.tls.certresolver=le

      # ✅ force cert apex + www
      - traefik.http.routers.bm-web.tls.domains[0].main=metalfrom.eu
      - traefik.http.routers.bm-web.tls.domains[0].sans=www.metalfrom.eu
      - traefik.http.routers.bm-web.service=bm-web
      - traefik.http.services.bm-web.loadbalancer.server.port=80
  quizz:
    image: nginx:alpine
    container_name: quizz
    networks:
      - stack-vps_admin
    volumes:
      - ./quizz-site:/usr/share/nginx/html:ro
    labels:
      - traefik.enable=true
      - traefik.docker.network=stack-vps_admin

      # ✅ règle de matching (OBLIGATOIRE)
      - traefik.http.routers.quizz.rule=Host(`quizz.nicolasfryder.ovh`)

      - traefik.http.routers.quizz.entrypoints=websecure
      - traefik.http.routers.quizz.tls=true
      - traefik.http.routers.quizz.tls.certresolver=le

      # ✅ force cert apex + www
      - traefik.http.routers.quizz.tls.domains[0].main=quizz.nicolasfryder.ovh
      - traefik.http.routers.quizz.service=quizz
      - traefik.http.services.quizz.loadbalancer.server.port=80
    restart: unless-stopped

networks:
  stack-vps_admin:
    external: true
