[Intro Music]
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
Node.js and express module. So
let's now go ahead and bring up all
those services. And for that we will
utilize as usually 'docker-compose
up' command. Also for 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
:8081. Also, mongo-express is
able to connect to mongo using its
hostname '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 'frontend'. Here they are.
And let's simply try to enter
command 'docker-compose up'. I will
omit for now '-d' option that
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.
Docker starts by pulling mongo
image from Docker Hub, it usually
consists of multiple layers. And
here you see that separate layers
are downloaded separately. Let's
wait a bit until the load process is complete.
mongo image was
successfully downloaded. Here I 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 frontend and api
containers are up to date, there
is no need to recreate them. But
it is necessary to create a new
container for mongo. Here I see
that a 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
sorts of logs here, and bring up
them in detached mode. Let's press
'CTRL+C' here, stopping all four
containers. mongo-express, mongo,
frontend 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.
[no audio]