set exposedByDefault to false in traefik to only expose docker containers that are enabled by label

This commit is contained in:
Bastian Hoyer committed 2024-03-03 08:24:44 +01:00
1 parent b09f8658ec
commit b94f6cd9d0
1 file changed
+2
@@ -12,6 +12,7 @@ services:
- --entrypoints.https.address=:443 - --entrypoints.https.address=:443
{{ end }} {{ end }}
- --providers.docker - --providers.docker
- --providers.docker.exposedByDefault=false
- --api={{ $.TRAEFIK_API_ENABLED }} - --api={{ $.TRAEFIK_API_ENABLED }}
- --api.dashboard={{ $.TRAEFIK_DASHBOARD_ENABLED }} - --api.dashboard={{ $.TRAEFIK_DASHBOARD_ENABLED }}
@@ -33,6 +34,7 @@ services:
{{ if eq $.TRAEFIK_API_ENABLED "true" }} {{ if eq $.TRAEFIK_API_ENABLED "true" }}
# Dashboard # Dashboard
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`{{ $.TRAEFIK_API_VHOST }}`)" - "traefik.http.routers.api.rule=Host(`{{ $.TRAEFIK_API_VHOST }}`)"
- "traefik.http.routers.api.service=api@internal" - "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints={{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}https{{ else }}http{{ end }}" - "traefik.http.routers.api.entrypoints={{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}https{{ else }}http{{ end }}"