Refactor Traefik configuration for improved TLS settings and service routing

This commit is contained in:
2025-11-11 20:44:14 +01:00
parent be6992d9e2
commit 70fba92035
3 changed files with 45 additions and 40 deletions
+19 -20
View File
@@ -4,26 +4,25 @@ services:
container_name: traefik
restart: unless-stopped
command:
- "--api.insecure=false"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=proxy"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--entryPoints.websecure.http.tls=true"
- "--entryPoints.web.http.redirections.entryPoint.to=websecure"
- "--entryPoints.web.http.redirections.entryPoint.scheme=https"
- --serversTransport.insecureSkipVerify=true
- "--providers.file.directory=/etc/traefik/dynamic/"
- "--providers.file.watch=true"
# Let's Encrypt
- "--certificatesresolvers.le.acme.email=${EMAIL:-bobrovod@national.shitposting.agency}"
- "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
- "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
- "--api.insecure=false"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik-proxy"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--entryPoints.websecure.http.tls=true"
- "--entryPoints.web.http.redirections.entryPoint.to=websecure"
- "--entryPoints.web.http.redirections.entryPoint.scheme=https"
- "--serversTransport.insecureSkipVerify=true"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-proxy"
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.workstation`)"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls=true"
ports:
- "80:80"
- "443:443"
@@ -32,9 +31,9 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/certs:/certs:ro
- ./traefik/dynamic:/etc/traefik/dynamic:ro
- ./traefik/letsencrypt:/letsencrypt
networks:
- traefik-proxy
networks:
traefik-proxy:
external: true