1
00:00:02,120 --> 00:00:05,310
Now, besides the two kinds of communication,

2
00:00:05,310 --> 00:00:08,039
the two kinds of requests you could say,

3
00:00:08,039 --> 00:00:09,810
I already talked about,

4
00:00:09,810 --> 00:00:11,880
container to worldwide web

5
00:00:11,880 --> 00:00:13,970
and container to host machine,

6
00:00:13,970 --> 00:00:16,750
there is one other form of communication

7
00:00:16,750 --> 00:00:19,910
you could encounter in your Dockerized app

8
00:00:19,910 --> 00:00:22,770
and that would be that your application

9
00:00:22,770 --> 00:00:24,820
running inside of your container

10
00:00:24,820 --> 00:00:27,790
wants to talk to another container.

11
00:00:27,790 --> 00:00:29,960
Let's say we have another container

12
00:00:29,960 --> 00:00:32,500
with a sequel database inside of it.

13
00:00:32,500 --> 00:00:34,900
Could all the be container with a Mongo DB

14
00:00:34,900 --> 00:00:36,160
database in a DOE

15
00:00:36,160 --> 00:00:37,920
or any aggro container,

16
00:00:37,920 --> 00:00:40,160
which is running some service

17
00:00:40,160 --> 00:00:41,540
to which you want to talk

18
00:00:41,540 --> 00:00:44,420
from inside your other container.

19
00:00:44,420 --> 00:00:45,410
So in this case,

20
00:00:45,410 --> 00:00:48,210
our application in the middle container

21
00:00:48,210 --> 00:00:51,430
might want to talk to this sequel database

22
00:00:51,430 --> 00:00:53,570
in another container.

23
00:00:53,570 --> 00:00:56,890
So communication between multiple containers

24
00:00:56,890 --> 00:00:59,960
is also a quite common scenario

25
00:00:59,960 --> 00:01:02,890
and in general, building applications

26
00:01:02,890 --> 00:01:06,030
with multiple containers is quite common.

27
00:01:06,030 --> 00:01:08,000
Up to this point in this course,

28
00:01:08,000 --> 00:01:11,370
we always worked with one container, right?

29
00:01:11,370 --> 00:01:13,630
We dockerized one pipe snap

30
00:01:13,630 --> 00:01:15,230
or one note app

31
00:01:15,230 --> 00:01:18,413
because we always had very simple application steer.

32
00:01:19,670 --> 00:01:21,430
Now, even though the demo app

33
00:01:21,430 --> 00:01:23,270
we're going to use in this module

34
00:01:23,270 --> 00:01:25,260
is also still quite simple,

35
00:01:25,260 --> 00:01:27,310
it's at least a bit more complex

36
00:01:27,310 --> 00:01:30,150
because here we actually, will have a great example,

37
00:01:30,150 --> 00:01:32,680
a great use case, a great scenario,

38
00:01:32,680 --> 00:01:35,830
where we might want to use multiple containers.

39
00:01:35,830 --> 00:01:38,160
Because with Docker containers,

40
00:01:38,160 --> 00:01:40,360
it is strongly recommended

41
00:01:40,360 --> 00:01:43,370
and the best practice that every container

42
00:01:43,370 --> 00:01:46,400
should just do one main thing.

43
00:01:46,400 --> 00:01:48,500
So if you have a note application,

44
00:01:48,500 --> 00:01:51,680
which also needs a Mongo DB database,

45
00:01:51,680 --> 00:01:53,100
it is a recommendation

46
00:01:53,100 --> 00:01:56,590
and the best practice that your note application,

47
00:01:56,590 --> 00:01:58,210
so does app JS file

48
00:01:58,210 --> 00:02:00,130
and all the required dependencies

49
00:02:00,130 --> 00:02:01,500
and Alden and models folder,

50
00:02:01,500 --> 00:02:02,920
which belongs to this app,

51
00:02:02,920 --> 00:02:05,700
go into one container and one image

52
00:02:05,700 --> 00:02:09,780
and your Mongo DB database uses another image

53
00:02:09,780 --> 00:02:11,720
and runs in another container.

54
00:02:11,720 --> 00:02:13,300
This is a best practice,

55
00:02:13,300 --> 00:02:15,240
and we're going to learn way more about

56
00:02:15,240 --> 00:02:17,650
multi container apps throughout this course.

57
00:02:17,650 --> 00:02:20,610
But this here is already a first example

58
00:02:20,610 --> 00:02:22,450
and therefore this example

59
00:02:22,450 --> 00:02:24,610
as well as most applications

60
00:02:24,610 --> 00:02:26,460
you're going to build with Docker,

61
00:02:26,460 --> 00:02:30,390
will typically need cross container communication

62
00:02:30,390 --> 00:02:34,000
and that will therefore be another form of communication

63
00:02:34,000 --> 00:02:35,930
and of networking,

64
00:02:35,930 --> 00:02:38,080
which we're going to take a closer look at

65
00:02:38,080 --> 00:02:39,113
in this module.

