I have two distinct docker
containers, independent from each other.
Now I want to talk from one to the other. Is that only possible by IP:PORT? Or even by application name?
This is the container I want to talk to:
docker-compose.yml
:
services:
my-container:
...
ports:
- "8090:8080"
extra_hosts:
- "host.docker.internal:host-gateway"
Is there a way that another container could simply connect to http://my-container
? Or would I always have to go the way injecting the host network ip with extra_hosts
to both containers, and then connect with http://host.docker.internal
?
Sidenote: all my containers are on the same default docker bridge network.