RE: Docker First Impressions

You are viewing a single comment's thread from:

Docker First Impressions

in docker •  7 years ago 

docker-compose by default sets up a user-defined network for the services so they can talk to each other using the service name (so you don't need to find out their IP).
If you really wanted however you could setup multiple containers with the same network stack (breaking some of the isolation. With this setup other containers can access them via their ports through localhost but that also allows them to see all of their network traffic.
Example: https://pastebin.com/raw/U7CHqQFf
Have a look at https://docs.docker.com/compose/networking/ and https://docs.docker.com/compose/compose-file/#network_mode

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Yeah, this was my first take on docker. It's pretty dated and overly complicated. The IP is the name of the service though configuring the app via ENV would be needed still. Essentially https://12factor.net/ is very helpful to getting docker to work well with your app.