traefik-inter-container-routing
traefik-inter-container-routing copied to clipboard
A note on static IPs
Nice write up!
Just an FYI as I've been looking into routing too.
Your README states:
A drawback is we need to give a static IP which points to traefik, which is not very handy.
(under the Add host entry to container heading).
I've recently noted that you can do this in a docker compose file:
extra_hosts:
- "keycloak.my.domain:host-gateway"
Where host-gateway is the important part that avoids IP references. So far I've just tested this on linux running Docker Engine, so I'm hoping it'll work on all platforms / install mechanisms.
Thank you very much @tonymcneil ! I think this is the best solution. The service in docker-compose can choose which services to resolve via host system.
No need to specify the traefik network and the connection just works. Well done!
Cheers