1
00:00:02,120 --> 00:00:03,810
In the last course module,

2
00:00:03,810 --> 00:00:05,740
we combined multiple containers

3
00:00:05,740 --> 00:00:09,010
to build one application consisting of a backend,

4
00:00:09,010 --> 00:00:11,533
which was a Node express API,

5
00:00:11,533 --> 00:00:15,230
a frontend, which was a React single page application

6
00:00:15,230 --> 00:00:17,720
and a Mongo Db database.

7
00:00:17,720 --> 00:00:21,530
We built this application by launching three containers,

8
00:00:21,530 --> 00:00:22,600
one for the database,

9
00:00:22,600 --> 00:00:23,433
one for the backend,

10
00:00:23,433 --> 00:00:24,710
one for the front end.

11
00:00:24,710 --> 00:00:28,060
We ensured that these containers could communicate

12
00:00:28,060 --> 00:00:30,410
with each other in different ways

13
00:00:30,410 --> 00:00:33,270
and of course we also added extra features

14
00:00:33,270 --> 00:00:38,270
like persistent data, live source code updates and so on.

15
00:00:38,490 --> 00:00:41,800
Now, the problem I have with the setup

16
00:00:41,800 --> 00:00:45,310
we created in the last module is this.

17
00:00:45,310 --> 00:00:48,750
I wrote down all the code docker commands

18
00:00:48,750 --> 00:00:52,700
we need to run to bring this setup to live.

19
00:00:52,700 --> 00:00:54,818
We need to create a network

20
00:00:54,818 --> 00:00:58,400
then we need to start our Mongo Db container

21
00:00:58,400 --> 00:01:00,370
with a quite long command

22
00:01:00,370 --> 00:01:02,360
because we add environmental variables,

23
00:01:02,360 --> 00:01:04,250
we add a volume and so on,

24
00:01:04,250 --> 00:01:06,387
we attach it to the network

25
00:01:06,387 --> 00:01:09,970
then we have to build our Node API image.

26
00:01:09,970 --> 00:01:13,460
Of course not every time but at least once,

27
00:01:13,460 --> 00:01:17,180
and then we can start our node backend container,

28
00:01:17,180 --> 00:01:19,530
and this is also a long command.

29
00:01:19,530 --> 00:01:21,250
Assigning environment variables,

30
00:01:21,250 --> 00:01:24,480
which are getting used in the node express application

31
00:01:24,480 --> 00:01:26,620
adding a couple of volumes

32
00:01:26,620 --> 00:01:29,463
and also attaching this to the network and so on.

33
00:01:30,310 --> 00:01:31,930
And then we need to build

34
00:01:31,930 --> 00:01:34,320
our react single application image,

35
00:01:34,320 --> 00:01:36,820
and then start our react container

36
00:01:36,820 --> 00:01:38,680
also with a bit mount,

37
00:01:38,680 --> 00:01:42,680
publishing the ports and an inter active mode,

38
00:01:42,680 --> 00:01:44,620
and if we wanna tear everything down,

39
00:01:44,620 --> 00:01:46,610
we have to stop all the containers

40
00:01:46,610 --> 00:01:49,610
and potentially, we then even have to remove

41
00:01:49,610 --> 00:01:53,240
networks or named volumes thereafter.

42
00:01:53,240 --> 00:01:54,900
So, long story short,

43
00:01:54,900 --> 00:01:57,250
there is a lot of work to be done here

44
00:01:57,250 --> 00:01:59,870
and this is just a basic application

45
00:01:59,870 --> 00:02:03,840
consisting of three different containers that work together.

46
00:02:03,840 --> 00:02:07,710
It's not unrealistic that you might wanna build applications

47
00:02:07,710 --> 00:02:10,919
that consist of even more containers.

48
00:02:10,919 --> 00:02:14,650
Now we can do something like this with Docker as you saw,

49
00:02:14,650 --> 00:02:18,110
and it's not horrible, but it's also not super convenient,

50
00:02:18,110 --> 00:02:21,080
and that's why the Docker ecosystem,

51
00:02:21,080 --> 00:02:22,700
ships with a naval tool,

52
00:02:22,700 --> 00:02:24,870
which is called, Docker Compose,

53
00:02:24,870 --> 00:02:29,620
which makes managing multi containers setups easier,

54
00:02:29,620 --> 00:02:33,240
it helps you automate the setup process

55
00:02:33,240 --> 00:02:36,330
and it allows you to bring up this entire setup,

56
00:02:36,330 --> 00:02:39,340
with all the different containers and their individual

57
00:02:39,340 --> 00:02:42,550
configurations with just one command.

58
00:02:42,550 --> 00:02:44,560
And you can then also tear everything down

59
00:02:44,560 --> 00:02:45,853
with just one command.

60
00:02:46,810 --> 00:02:48,090
Now, in this module,

61
00:02:48,090 --> 00:02:49,450
we going to have a closer look

62
00:02:49,450 --> 00:02:51,820
at this Docker Composed tool.

63
00:02:51,820 --> 00:02:54,170
We going to learn what exactly it is,

64
00:02:54,170 --> 00:02:57,220
and of course we also going to learn how we can use it

65
00:02:57,220 --> 00:03:00,000
and how we can utilize Docker Compose

66
00:03:00,000 --> 00:03:04,120
to make working with this multi container application

67
00:03:04,120 --> 00:03:06,173
a bit more convenient and easier.

