name: traefik services: traefik: container_name: traefik image: traefik:{{ traefik_version }} restart: unless-stopped security_opt: - no-new-privileges:true ports: - "80:80" - "443:443" - "{{ wireguard_ip }}:{{ traefik_dashboard_port }}:8080" # Dashboard on WireGuard IP only volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - ./traefik.yml:/traefik.yml:ro - ./config:/config:ro - ./letsencrypt:/letsencrypt - ./logs:/var/log/traefik networks: - {{ traefik_network }} env_file: - .env environment: - TZ=UTC labels: - "traefik.enable=true" - "traefik.docker.network={{ traefik_network }}" # Dashboard Router with IP Whitelist - "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.asxp.io`)" - "traefik.http.routers.traefik-dashboard.entrypoints=websecure" - "traefik.http.routers.traefik-dashboard.tls=true" - "traefik.http.routers.traefik-dashboard.tls.certresolver=letsencrypt" - "traefik.http.routers.traefik-dashboard.service=api@internal" # IP Whitelist Middleware (VPC + WireGuard) - "traefik.http.middlewares.traefik-ipwhitelist.ipwhitelist.sourcerange=10.10.0.0/20,10.20.0.0/24" - "traefik.http.routers.traefik-dashboard.middlewares=traefik-ipwhitelist" networks: {{ traefik_network }}: external: true