I use docker-compose
to build an application consisting of multiple docker containers. Those containers communicate using the default bridge get some IP address on that private network and publish there services on those IP addresses.
From within the containers I can access other containers simply by their name.
If I want to access such a service from the host it is possible to simply access the internal IP address on the bridge. However the exact IP address for each service is not obvious and might change after a restart.
Is there a way to easily access a docker service by name from the host?
(Yes, exposing a port on localhost would be an alternative, but for debugging it would be much more convenient to access services directly through the bridge.)