Repository navigation
Feature request: interpolate ${VAR} in Docker Compose labels, and let a label-defined middleware stay off the generated router
#12479
PhilippMolitor
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Use case
I run several deployments of one Compose file (production, staging, previews) on the same Traefik. I want a referer allowlist on an image service: a second router on the service's domain that answers 403 when
Refereris another site. Each deployment needs its own host and app origin in the rule, and unique router and middleware names:What happens now
${SERVICE_NAME_*},${SERVICE_FQDN_*}and${SERVICE_URL_*}stay literal text in the container labels, so the rule never matches.traefik.http.middlewares.<name>.*label is added to the generated router (bootstrap/helpers/docker.php, the$middlewares_from_labelsblock). A middleware meant only for my own router, here a deny-allipallowlist, ends up on the main router and blocks all traffic.Ask
SERVICE_*variables (and other env variables) in labels before escaping$, or document how to use them in labels.coolify.traefik.exclude-middlewares=<name>label. Another option is to attach only the middlewares named incoolify.traefik.middlewares.All reactions