Skip to content

Traefik

Tutorials

kb-tpl-docker-traefik

About ports:

We didn't have to tell Traefik to which ports to proxy to, even though our API, for example, uses port 3000. This is because traefik inspect exposed ports of the container (NOT exposed in the service, but exposed using EXPOSE keyword in Dockerfile). If our container didn't have a port exposed or had multiple ports exposed, we would use a label like this to specify the port:

docker-compose.yml
labels:
  # ...
  - "traefik.http.services.<service_name>.loadbalancer.server.port=8080" # 8080 is the port we proxy to

How To Use Traefik v2 as a Reverse Proxy for Docker Containers on Ubuntu 20.04

Ultimate Traefik Docker Compose Guide [2022] with LetsEncrypt ,


Last update: 2023-01-26