services: traefik: image: traefik:v3.7.4 container_name: traefik restart: unless-stopped command: # API - "--api.insecure=true" - "--api.dashboard=true" # Providers - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--providers.docker.network=proxy" - "--providers.file.directory=/etc/traefik/dynamic" - "--providers.file.watch=true" # EntryPoints - "--entryPoints.web.address=:80" - "--entryPoints.web.http.redirections.entryPoint.scheme=https" - "--entryPoints.web.http.redirections.entryPoint.to=websecure" - "--entryPoints.websecure.address=:443" - "--entryPoints.websecure.http.middlewares=error-pages@docker" - "--entryPoints.websecure.http.tls=true" - "--entryPoints.ssh.address=:2221" # Let's Encrypt - "--certificatesresolvers.letsencrypt.acme.email=${EMAIL}" - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json" - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true" - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" # # STAGING # - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" # Cloudflare - "--entryPoints.web.forwardedHeaders.trustedIPs=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22" - "--entryPoints.websecure.forwardedHeaders.trustedIPs=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22" # Logging - "--log.level=INFO" - "--log.filePath=/var/log/traefik/traefik.log" - "--log.format=json" - "--accesslog=true" - "--accesslog.filepath=/var/log/traefik/access.log" labels: - "traefik.enable=true" # Prod Router (Dash) - "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.forust.xyz`)" - "traefik.http.routers.traefik-dashboard.entrypoints=websecure" - "traefik.http.routers.traefik-dashboard.middlewares=security-chain@file" - "traefik.http.routers.traefik-dashboard.service=api@internal" - "traefik.http.routers.traefik-dashboard.tls=true" # Local Router - "traefik.http.routers.traefik-dashboard-local.rule=Host(`traefik.workstation.internal`)" - "traefik.http.routers.traefik-dashboard-local.entrypoints=websecure" - "traefik.http.routers.traefik-dashboard-local.service=api@internal" - "traefik.http.routers.traefik-dashboard-local.tls=true" # Dev Router - "traefik.http.routers.traefik-dashboard-dev.rule=Host(`traefik.gigaforust.internal`)" - "traefik.http.routers.traefik-dashboard-dev.entrypoints=websecure" - "traefik.http.routers.traefik-dashboard-dev.service=api@internal" - "traefik.http.routers.traefik-dashboard-dev.tls=true" # Glance Metadata - glance.name=Traefik - glance.url=https://traefik.forust.xyz/ - glance.description=Traefik is a modern reverse proxy and load balancer volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./dynamic:/etc/traefik/dynamic:ro - ./certs:/certs:ro - ./logs:/var/log/traefik - ./letsencrypt:/letsencrypt ports: - "80:80" - "443:443" networks: - proxy networks: proxy: external: true