We just added two additional services to our Docker compose file, namely Mongo and Mongo Express.
Mongo image contains actual MongoDB daemon with Mongo CLI utility and Mongo Express is graphical user
interface for Mongo and Mongo Express is written using NodeJS and express module.
So let's now go ahead and bring up all those services and for that we will utilize as usual Docker compose
up command also from Mongo Express container, we expose internal port 8081 to external port 8081 on
your computer.
And that means that we will be able to connect to Mongo Express application using any web browser using
address localhost colon 8081.
Also, Mongo Express is able to connect to Mongo using its host name Mongo and corresponding credentials
for admin user of the database root is username for such user and password is its password.
All right.
Let's now go ahead and bring up those services.
Let's go to the terminal where I'm already running such containers as API and front end.
Here they are.
And let's simply try to enter Command Docker compose up.
I will omit for now the option D stands for detached because I want to show you actual logs that will
be generated by Mongo and Mongo express containers.
That's why.
Let's simply enter Docker.
Compose up like that.
Let's go ahead.
Looker starts by pulling mongo image from Docker hub as usually it consists of multiple layers and here
you see that separate layers are downloaded separately.
Let's wait a bit until download process is complete.
Mongo image was successfully downloaded here.
See?
Status informational message about that.
And now docker compose is pulling mongo express and similarly it consists of multiple layers and all
those layers are downloaded and afterwards extracted.
Mongo Express image was downloaded as well.
And you see also that front end and containers are up to date.
There is no need to recreate them, but it is necessary to create new container for mongo.
Here I see that new container was created and also new container for Mongo Express was created as well.
And afterwards I see actual logs from mongo express container.
Here they are.
And from mongo container for instance.
Here, let me scroll to the very end of this output.
And for instance here I see such message as admin database connected that comes from mongo express container
and also a bit up.
I should see database connected message.
And yes, here it is.
It also comes from mongo express on mongo container.
I see such message as successful authentication and that means that mongo express successfully authenticated
at mongo connection.
Accepted message also comes from mongo container and it seems that now connectivity between mongo express
and Mongo is established.
And notice here that in client section Mongo shows us IP address of the Mongo express container.
That's what I told you before.
All containers communicate with each other using IP addresses and those IP addresses are assigned by
Docker internally.
All right.
Let me actually bring down now all those containers in order to avoid all the logs here and bring up
them in detached mode, Let's press Ctrl C here, stopping all four containers, Mongo Express, Mongo
front end and API containers were stopped.
Now there are no containers running.
And now let's bring them up again using command docker.
Compose up with option D detached.
Let's do that.
Now, there is no need to pull new images for Mongo and Mongo Express because they are already present
locally in Docker cache.
That's why it makes sense only to start new containers and that's what Docker does here on those lines.
Starting all four containers.
Containers were started.
Here they are.
And now let's actually explore those containers.
And first, after the small pause, let me explain to you how to get information about containers using
Docker desktop dashboard.
This one.
I'll see you guys just in a moment.