In the last course module,
we combined multiple containers
to build one application consisting of a backend,
which was a Node express API,
a frontend, which was a React single page application
and a Mongo Db database.
We built this application by launching three containers,
one for the database,
one for the backend,
one for the front end.
We ensured that these containers could communicate
with each other in different ways
and of course we also added extra features
like persistent data, live source code updates and so on.
Now, the problem I have with the setup
we created in the last module is this.
I wrote down all the code docker commands
we need to run to bring this setup to live.
We need to create a network
then we need to start our Mongo Db container
with a quite long command
because we add environmental variables,
we add a volume and so on,
we attach it to the network
then we have to build our Node API image.
Of course not every time but at least once,
and then we can start our node backend container,
and this is also a long command.
Assigning environment variables,
which are getting used in the node express application
adding a couple of volumes
and also attaching this to the network and so on.
And then we need to build
our react single application image,
and then start our react container
also with a bit mount,
publishing the ports and an inter active mode,
and if we wanna tear everything down,
we have to stop all the containers
and potentially, we then even have to remove
networks or named volumes thereafter.
So, long story short,
there is a lot of work to be done here
and this is just a basic application
consisting of three different containers that work together.
It's not unrealistic that you might wanna build applications
that consist of even more containers.
Now we can do something like this with Docker as you saw,
and it's not horrible, but it's also not super convenient,
and that's why the Docker ecosystem,
ships with a naval tool,
which is called, Docker Compose,
which makes managing multi containers setups easier,
it helps you automate the setup process
and it allows you to bring up this entire setup,
with all the different containers and their individual
configurations with just one command.
And you can then also tear everything down
with just one command.
Now, in this module,
we going to have a closer look
at this Docker Composed tool.
We going to learn what exactly it is,
and of course we also going to learn how we can use it
and how we can utilize Docker Compose
to make working with this multi container application
a bit more convenient and easier.