Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added port so that the service-name of static is independent #283

Closed
wants to merge 1 commit into from

Conversation

hpwjnijs
Copy link

So traefik sees the 'static' service as static-<directory>@docker and that how it is addressed. But you want to have it directory independent. There is no direct way to name/label your service , but according to this you can fix this by e.g.

labels:

  • traefik.http.services.<<name_of_service>>.loadbalancer.server.port=80

So, that's what we do here.
It fixes #214

(N.B Split up from #278)

@edevosc2c
Copy link
Member

edevosc2c commented May 24, 2024

Hello Nijs, thank you for the PR.

The issue lies way deeper than that. For every case where you see "@docker", it's actually the name of the directory.

Which means that even if we make traefik to detect the services, but we would still miss the middlewares like "traefik.http.middlewares.traefik-strip", "traefik.http.middlewares.corsheader" and more.

The real solution is to stop using docker labels for making traefik to discover the services. If we still want to use traefik then we should use traefik static config.

Or there is a pending PR for switching to caddy which aims to solve the issue #214: #268

@hpwjnijs
Copy link
Author

hpwjnijs commented Jun 4, 2024

Hello Nijs, thank you for the PR.

The issue lies way deeper than that. For every case where you see "@docker", it's actually the name of the directory.

Which means that even if we make traefik to detect the services, but we would still miss the middlewares like "traefik.http.middlewares.traefik-strip", "traefik.http.middlewares.corsheader" and more.

The real solution is to stop using docker labels for making traefik to discover the services. If we still want to use traefik then we should use traefik static config.

Or there is a pending PR for switching to caddy which aims to solve the issue #214: #268

AFAIK is "@docker" not the directory; We have never experienced any issues (with our other projects) when starting in a different named directory.

@edevosc2c edevosc2c mentioned this pull request Sep 27, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Directory name needs to be named "docker"
2 participants