Open elindgren opened 10 months ago
I might be wrong, but I've used the following labels and my other containers are successfully integrated in Traefik:
labels:
- traefik.enable=true
- traefik.docker.network=traefik
- traefik.http.routers.[NAME].entrypoints=web-secure
- traefik.http.routers.[NAME].service=[NAME]
- traefik.http.routers.[NAME].rule=[RULE]
- traefik.http.routers.[NAME].tls=true
- traefik.http.routers.[NAME].tls.certResolver=default
- traefik.http.routers.[NAME].tls.domains[0]=[DOMAIN]
- traefik.http.routers.[NAME].tls.domains[0].sans=[SUBDOMAIN]
- traefik.http.services.[NAME].loadbalancer.server.port=[CONTAINER PORT]
Also adding the networks config under the compose services:
networks:
- traefik
and under the compose networks:
networks:
traefik:
external: true
I might be wrong, but I've used the following labels and my other containers are successfully integrated in Traefik:
labels: - traefik.enable=true - traefik.docker.network=traefik - traefik.http.routers.[NAME].entrypoints=web-secure - traefik.http.routers.[NAME].service=[NAME] - traefik.http.routers.[NAME].rule=[RULE] - traefik.http.routers.[NAME].tls=true - traefik.http.routers.[NAME].tls.certResolver=default - traefik.http.routers.[NAME].tls.domains[0]=[DOMAIN] - traefik.http.routers.[NAME].tls.domains[0].sans=[SUBDOMAIN] - traefik.http.services.[NAME].loadbalancer.server.port=[CONTAINER PORT]
Also adding the networks config under the compose services:
networks: - traefik
and under the compose networks:
networks: traefik: external: true
Nice, thanks! I tried it but there is still something that doesn't seem to be quite correctly configured. What is [NAME], is that just name of the docker service (webserver
in my example yaml file)? What is RULE
?
Yes, [NAME]
is the container/service name, webserver
in your case. [RULE]
should be your routing rule, according to https://doc.traefik.io/traefik/routing/routers/#rule_1, like Host(`subdomain.myserver.org`)
Hi! I want to use the included
traefik
reverse proxy to also handle requests to an additional webserver I'm running in a docker container on the same server as all the other services. I followed this section of the docs where, if I understand correctly, I can add my service totraefik
simply by specifying the correct labels for my docker service. See the configuration I use in mydocker-compose.yaml
below.My service can join the
traefik
docker network just fine, but when I accesshttps://subdomain.myserver.org
I get a 404 not found. I suspect I've misconfigured thetraefik
labels, specifically with regards to thetraefik
router name (it's probably notmyrouter
as I've used 😆), but I don't know what it should be. Anyone that can help a struggling hobbyist out? 😅docker-compose.yaml