I have a docker compose file with two services. One service exposes a port and is configured in the (default) bridge network mode. The other service needs to connect to the exposed port and has to be in the host network mode.
How can I make the "host network" service connect to a port exposed by the "bridge network" service? localhost
, 127.0.0.1
, or the name of the service does not work.
Currently I am using:
- Docker version 20.10.21
- Docker Compose version v2.11.1
- Docker Compose file version 3.5