Specifying service port

Greetings
I've setup my first Traefik with a few docker services. Most of them work ok. Some however don't, but I don't understand why. It seems Traefik cannot connect to them. I'm starting with basic configuration: no load balancing, just Traefik as a proxy and a few containers on Traefik's docker network.
For example, here is a part of my yml file:

    labels:
      - traefik.enable=true
      - traefik.port=7073
      - traefik.docker.network=traefik_default

But in the dashboard, Traefik shows:

http://172.20.0.5:7072

What's happening? how can I specify the port of my service?

Thanks in advance

Note that the container have only 1 port open, port 7073, and that port 7072 is not open.
Also it's basic docker, not swarm.

Check out traefik v2 documentation, it looks like you are using v1 labels.

1 Like

+1 with @zespri: check https://docs.traefik.io/v2.0/routing/providers/docker/ , in particular the label traefik.http.services.<service_name>.loadbalancer.server.port :slight_smile:

Oh you mean I have to declare a load balancer even if there's so need for load balancing? that was unclear from the documentation which I read several times. Moreover, all the litterature available seem to relate only to v1, which is very confusing...
But thanks, it's working now, I still don't know why port 7072 was chosen, but now I'm able to specify the correct port.

1 Like