From 2d30694f6ebebd64d124f7fb73e2097eabf2f9dc Mon Sep 17 00:00:00 2001 From: Teck Meng Date: Wed, 5 Jun 2024 12:43:27 +0800 Subject: [PATCH] Refactor Traefik configuration in swarm/core.yml to use special Traefik service for web UI/Dashboard --- swarm/core.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/swarm/core.yml b/swarm/core.yml index 3f6f315..1a2700c 100644 --- a/swarm/core.yml +++ b/swarm/core.yml @@ -66,12 +66,12 @@ services: - traefik.http.routers.traefik-public-https.rule=Host(`dashboard.${DOMAIN?Variable not set}`) - traefik.http.routers.traefik-public-https.entrypoints=https - traefik.http.routers.traefik-public-https.tls=true - # Use the special Traefik service api@internal with the web UI/Dashboard - - traefik.http.routers.traefik-public-https.service=api@internal # Use the "le" (Let's Encrypt) resolver created below - traefik.http.routers.traefik-public-https.tls.certresolver=le # Enable HTTP Basic auth, using the middleware created above - traefik.http.routers.traefik-public-https.middlewares=admin-auth + # Use the special Traefik service api@internal with the web UI/Dashboard + - traefik.http.routers.traefik-public-https.service=api@internal # Define the port inside of the Docker service to use - traefik.http.services.traefik-public.loadbalancer.server.port=8080 volumes: @@ -90,6 +90,7 @@ services: # Enable Docker Swarm mode - --providers.swarm.exposedbydefault=false - --providers.swarm.endpoint=unix:///var/run/docker.sock + - --providers.swarm.network=traefik-public # Create an entrypoint "http" listening on port 80 - --entrypoints.http.address=:80 # Create an entrypoint "https" listening on port 443