version: "3.8"

services:
  scripts_static:
    image: nginx:1.27-alpine
    networks:
      - traefik_public
    volumes:
      - /root/scripts-static:/usr/share/nginx/html:ro
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost"]
      interval: 30s
      timeout: 10s
      retries: 3
    deploy:
      placement:
        constraints:
          - node.role == manager
      labels:
        - traefik.enable=true
        - traefik.http.routers.scripts.rule=Host(`scripts.rever.com.br`)
        - traefik.http.routers.scripts.entrypoints=websecure
        - traefik.http.routers.scripts.tls.certresolver=le
        - traefik.http.services.scripts.loadbalancer.server.port=80
      restart_policy:
        condition: any
        delay: 5s
        max_attempts: 3

networks:
  traefik_public:
    external: true
