Wrap dashboard routing definition in conditional

This ensures that we don't define the routes for the api unless we've enabled it.
This commit is contained in:
Adam Cooper
2022-11-11 21:58:16 +00:00
committed by GitHub
parent 14ba1a214f
commit a60ba4e2d4

View File

@@ -24,10 +24,13 @@ services:
{{ end }}
labels:
{{ if $.TRAEFIK_API_ENABLED }}
# Dashboard
- "traefik.http.routers.api.rule=Host(`{{ $.TRAEFIK_API_VHOST }}`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints={{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}https{{ else }}http{{ end }}"
{{ end }}
- "traefik.http.routers.middlewares=auth"
{{ if $.TRAEFIK_BASIC_AUTH }}
- "traefik.http.middlewares.auth.basicauth.users={{ $.TRAEFIK_BASIC_AUTH }}"