Docker how to send request(curl - get, post) one container to another container
Using docker networking and the network commands, you can make sure those containers are part of the same network.
A side-effect of that unique network will be container A will know of container B name: from totp_api
, you can ping or curl the service
container with its name:
ping service
You can:
- do it statically in the docker compose file (and relaunch new containers), - test it out at runtime, adding existing running containers to a new network