Let me know, explain to you how different containers communicate with each other when you bring them
up using Docker compose instead of the Docker Compose creates new breach network.
And we've seen logs about that region network is assigned specific range of IP addresses.
For example, you might see such range 172 22 zero zero 16 16 is Network Maersk for this particular
network.
And each container that is included in the Docker compose file gets unique IP address from this range.
For example, on my computer, containers were assigned sadjapour addresses front and container.
Such payload was API container or got such a payload was Mongo.
This one and Mongo expressed this one again.
Those IP addresses are different, but they belong to the same network.
This network, in this example also there was default gateway for each container and usually default
gateways.
A third was ants with one in the last octet, and it is first usable IP address in this network.
Also, there was port mapping for several containers in Docker compose configuration file and there
was port three thousand exposed by front and container, and it is exposed to the same port three thousand
on the local computer where you are run Docker.
50 50 brought is brought exposed by API container, and it is exported the same brought on local computer
5:50pm and Mongo Express container also has exports.
Port 80, a dual Mongo container, does not have any exposed ports, but it does not stop all the containers
from communication with Mongo container due to the fact that all those containers internally inside
it was a Docker belong to the same network and they could communicate with each other using their IP
addresses.
Other than that, instead of the Docker, there was also a DNS server.
And instead of that DNS server, Docker creates corresponding DNS mappings for the names of the services
defined inside of the Docker compose file to corresponding IP addresses assigned to the containers.
And this means that, for example, front and container might reach one container, either by its name
Mongo, that will be the result of this eBay address or directly knowing the CPRS.
But IP addresses might be assigned differently each moment when you start Docker compose.
But those services names front and API Munguia and Montebourg Express remain unchanged.
This way, if you want to communicate between containers internally in this network, you could simply
utilize services names, for example Mongo or API.
That's what we do instead of the Mongo Express container.
We define that there are server name of the Mongo server simply as Mongo.
And this name will be resolved internally by internal DNS servers of the Docker.
To this, a build was in my example.
Also note is that on your computer or such network for all those containers might be different from
mine, but usually range starts with one hundred seventy two.
And those IP addresses from those ranges are considered as private data addresses.
They are not available in the global network internet, and there is no need to record them because
actually between those containers inside it was a Docker and old site internet connection.
There was network address translation that is also done by Docker internally.
And this why each of the containers has access to internet.
If your computer where you're running Docker has access to the internet, and that's why we were able
to download, for example, npm packages in the front of the container or download Python packages inside
of the API container.
This network and works instead of a Docker when you bring up multiple services simultaneously using
Docker compose and next up to the small balls of growth, let's examine that in practice.
I'll see you just in a bit.