So this is my docker-compose file
version: '3'
networks:
traefik-net:
driver: bridge
services:
# The reverse proxy service (Træfik)
reverse-proxy:
image: traefik # The official Traefik docker image
ports:
- "80:80" # The HTTP port
- "8082:8082" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/etc/traefik/traefik.toml
labels:
- "traefik.docker.network=traefik-net"
networks:
- traefik-net
auth:
image: auth
labels:
- "traefik.enable=true"
- "traefik.backend=auth"
- "traefik.frontend.rule=Host:auth.localhost"
- "traefik.docker.network=traefik-net"
networks:
- traefik-net
clients:
image: clients
labels:
- "traefik.enable=true"
- "traefik.backend=clients"
- "traefik.frontend.rule=Host:clients.localhost"
- "traefik.docker.network=traefik-net"
networks:
- traefik-net
and this is my traefik.toml file
defaultEntryPoints = ["http"]
[api]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "traefik.localhost"
watch = true
[entryPoints]
[entryPoints.traefik]
address = ":8082"
[entryPoints.http]
address = ":80"
What i am trying to do is to make a request from auth container to the clients container Inside the auth container i execute this commande
wget -qO- --header="Host: clients.localhost" http://localhost/
i get this output
wget: can't connect to remote host (127.0.0.1): Connection refused
outside the container the commande works just fine. what can i do to make requests from one container to the other using traefik
thanks for the help :)