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

This commit is contained in:
Bastian Hoyer
2024-03-03 08:17:33 +01:00
parent b09f8658ec
commit b94f6cd9d0

View File

@@ -12,6 +12,7 @@ services:
- --entrypoints.https.address=:443
{{ end }}
- --providers.docker
- --providers.docker.exposedByDefault=false
- --api={{ $.TRAEFIK_API_ENABLED }}
- --api.dashboard={{ $.TRAEFIK_DASHBOARD_ENABLED }}
@@ -33,6 +34,7 @@ services:
{{ if eq $.TRAEFIK_API_ENABLED "true" }}
# Dashboard
- "traefik.enable=true"
- "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 }}"