This commit is contained in:
Philip Cheung 2024-10-08 16:02:08 +08:00
parent ed00da9d92
commit b7d4fdfb8e
1 changed files with 8 additions and 19 deletions

View File

@ -17,26 +17,15 @@ services:
- traefik.enable=true - traefik.enable=true
- traefik.docker.network=traefik-public - traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public - traefik.constraint-label=traefik-public
- traefik.http.routers.${STACK_NAME?Variable not set}-app-http.rule=Host(`${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-app-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-app-http.middlewares=https-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-app-https.rule=Host(`${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-app-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-app-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-app-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-app.loadbalancer.server.port=3000
# - traefik.http-allAndOne.loadbalancer.server.port=80
# - traefik.http.routers.allAndOne-http.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
# - traefik.http.routers.allAndOne-http.entrypoints=http
# - traefik.http.routers.allAndOne-https.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
# - traefik.http.routers.allAndOne-https.entrypoints=https
# - traefik.http.routers.allAndOne-https.tls=true
# - traefik.http.routers.allAndOne-https.tls.certresolver=le
- traefik.basic.allinone.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
- "traefik.basic.port=80"
- "traefik.basic.protocol=http"
- traefik.http.routers.allinone-https.middlewares=www-redirect
- traefik.http.routers.allinone-http.middlewares=https-redirect,www-redirect
# Enable www redirection for HTTP and HTTPS
# - traefik.http.routers.allAndOne-https.middlewares=www-redirect
# - traefik.http.routers.allAndOne-http.middlewares=https-redirect,www-redirect
networks: networks:
- traefik-public - traefik-public
- default - default