I just made a quick overview of the Moon and Moon Express official Docker images, and now it's time
to create additional services in our own Docker compose file and add their Mongo and Monaco Express
services in order to save some time.
Let's simply grab those lines from this example and insult them to the Docker compose file.
Let's go there, and let's insert those services below API here.
Make sure that you go to the same level as API and front end services here in this Yamal file and based
corporate lines like that, and make sure that formatting is correct.
And let's, of course, make some adjustments here.
There also is Mongo and the hear whispers if I image and it means for Docker that we want to use official
image from the Docker hop hero's name or such image.
And if you want, you could also at Caltech lead us, but we will admit it.
In such case, Docker will attack latest automatically.
Let's keep or start always here and here.
Same as in the example.
In such case, Docker will restart containers automatically in case of any failures and environment.
Variables here will be kept, as you'll see here.
But let's change this example password to a NAS, or let's say, very this strong db, this password
like that.
And also, let's take this password and insert it here instead of this example password.
Also here in Mongo Express section, let's add one more environment variable gold and eve underscore
config underscore MongoDB under a scroll etc column and well, you will be Mongo.
He does name of the Mongo service here, and I told you in the previous lecture that such Mongo hostname
instead was a Docker will be resolved by DNS of the Docker to correspondent IP address of the running
container container that will be running Mongo servers.
And of course, I'll show you how it looks from inside.
Also here you see both mapping and internal brought.
A Dubon inside of the Mongo Express is mapped to external brought on your computer aided 12:52, and
that means that you will be able to access graphical user interface of the Mongo Express because it
has actually it is based on the express and more, and it means that you will be able to access it in
any web browser using local host Golden 88 to one address.
But notice that Mongo doesn't have any exposed ports.
It doesn't mean that the Mongo does not utilize ports.
Of course, it uses corresponding ports in order to be able to accept incoming requests.
But Mongo will not be exposed to outside world.
It will be available only from all the containers, for example, from one express or from API.
Because usually eBay's servers communicate directly with databases, and the Noah Project API container
should interact with Mongo container, and it is possible inside of the Docker using Mongo as a hostname
of the Mongo container.
And again, there was no need to expose Mongeau to outside world and to add for something Mongeau Express
will communicate with Mongeau internally.
All right.
That's actually all configuration that needs to be done in order to bring up two additional services,
mourn and mourn, Go Express and basically let me add one more instruction here and to scold depends
on underscore on and with such instruction in place, you could at least of the containers that current
container depends on.
And with such configuration, if you enter here, for instance, Morning Good Morning Express container
will be started by Docker only after start of the morning.
The container that's what depends on instruction means.
That's why let's give this instruction here.
We want to start Moonglow Express after Mongo and let's say changes here in this Docker compose file.
Now there are four different services front and API Mongo and Mongo Express.
Let's not go ahead and using Docker compose up command, bring up those two additional services.
But let's do that, of course, after the small balls.