services:
  traefik:
    image: traefik:v3.0
    container_name: traefik
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    ports:
      - "80:80"
      - "443:443"  
      - "8080:8080"
    environment:
      - CF_DNS_API_TOKEN={{ cloudflare_api_token | default('') }}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data/traefik.yml:/traefik.yml:ro
      - ./data/dynamic:/etc/traefik/dynamic:ro
      - ./data/acme.json:/acme.json
      - /var/log/traefik:/var/log/traefik
    labels:
      - "traefik.enable=true"

networks:
  proxy:
    external: true
