1
00:00:04,140 --> 00:00:10,320
We just added two additional services to our Docker compose file, namely Mongo and Mongo Express.

2
00:00:10,350 --> 00:00:18,570
Mongo image contains actual MongoDB daemon with Mongo CLI utility and Mongo Express is graphical user

3
00:00:18,570 --> 00:00:24,900
interface for Mongo and Mongo Express is written using NodeJS and express module.

4
00:00:25,140 --> 00:00:32,159
So let's now go ahead and bring up all those services and for that we will utilize as usual Docker compose

5
00:00:32,189 --> 00:00:40,410
up command also from Mongo Express container, we expose internal port 8081 to external port 8081 on

6
00:00:40,410 --> 00:00:41,550
your computer.

7
00:00:41,550 --> 00:00:47,910
And that means that we will be able to connect to Mongo Express application using any web browser using

8
00:00:47,940 --> 00:00:50,880
address localhost colon 8081.

9
00:00:51,180 --> 00:00:58,920
Also, Mongo Express is able to connect to Mongo using its host name Mongo and corresponding credentials

10
00:00:58,920 --> 00:01:05,740
for admin user of the database root is username for such user and password is its password.

11
00:01:06,340 --> 00:01:06,970
All right.

12
00:01:06,970 --> 00:01:10,540
Let's now go ahead and bring up those services.

13
00:01:10,570 --> 00:01:16,660
Let's go to the terminal where I'm already running such containers as API and front end.

14
00:01:16,690 --> 00:01:17,800
Here they are.

15
00:01:17,950 --> 00:01:21,790
And let's simply try to enter Command Docker compose up.

16
00:01:22,060 --> 00:01:28,120
I will omit for now the option D stands for detached because I want to show you actual logs that will

17
00:01:28,120 --> 00:01:31,330
be generated by Mongo and Mongo express containers.

18
00:01:31,330 --> 00:01:31,900
That's why.

19
00:01:31,930 --> 00:01:33,160
Let's simply enter Docker.

20
00:01:33,160 --> 00:01:34,750
Compose up like that.

21
00:01:34,780 --> 00:01:35,830
Let's go ahead.

22
00:01:37,260 --> 00:01:43,950
Looker starts by pulling mongo image from Docker hub as usually it consists of multiple layers and here

23
00:01:43,950 --> 00:01:47,310
you see that separate layers are downloaded separately.

24
00:01:47,340 --> 00:01:50,160
Let's wait a bit until download process is complete.

25
00:01:51,380 --> 00:01:54,080
Mongo image was successfully downloaded here.

26
00:01:54,200 --> 00:01:54,380
See?

27
00:01:54,410 --> 00:01:56,660
Status informational message about that.

28
00:01:56,660 --> 00:02:04,070
And now docker compose is pulling mongo express and similarly it consists of multiple layers and all

29
00:02:04,070 --> 00:02:07,430
those layers are downloaded and afterwards extracted.

30
00:02:08,180 --> 00:02:11,090
Mongo Express image was downloaded as well.

31
00:02:11,090 --> 00:02:16,040
And you see also that front end and containers are up to date.

32
00:02:16,040 --> 00:02:21,500
There is no need to recreate them, but it is necessary to create new container for mongo.

33
00:02:21,530 --> 00:02:28,580
Here I see that new container was created and also new container for Mongo Express was created as well.

34
00:02:28,580 --> 00:02:33,410
And afterwards I see actual logs from mongo express container.

35
00:02:33,410 --> 00:02:34,270
Here they are.

36
00:02:34,280 --> 00:02:36,770
And from mongo container for instance.

37
00:02:36,770 --> 00:02:39,950
Here, let me scroll to the very end of this output.

38
00:02:39,950 --> 00:02:46,730
And for instance here I see such message as admin database connected that comes from mongo express container

39
00:02:46,730 --> 00:02:48,680
and also a bit up.

40
00:02:48,680 --> 00:02:50,600
I should see database connected message.

41
00:02:50,600 --> 00:02:51,890
And yes, here it is.

42
00:02:51,920 --> 00:02:56,420
It also comes from mongo express on mongo container.

43
00:02:56,420 --> 00:03:03,410
I see such message as successful authentication and that means that mongo express successfully authenticated

44
00:03:03,410 --> 00:03:05,000
at mongo connection.

45
00:03:05,000 --> 00:03:12,170
Accepted message also comes from mongo container and it seems that now connectivity between mongo express

46
00:03:12,170 --> 00:03:14,600
and Mongo is established.

47
00:03:14,600 --> 00:03:22,490
And notice here that in client section Mongo shows us IP address of the Mongo express container.

48
00:03:22,520 --> 00:03:24,200
That's what I told you before.

49
00:03:24,230 --> 00:03:30,770
All containers communicate with each other using IP addresses and those IP addresses are assigned by

50
00:03:30,800 --> 00:03:32,210
Docker internally.

51
00:03:32,480 --> 00:03:33,200
All right.

52
00:03:33,200 --> 00:03:40,250
Let me actually bring down now all those containers in order to avoid all the logs here and bring up

53
00:03:40,250 --> 00:03:48,560
them in detached mode, Let's press Ctrl C here, stopping all four containers, Mongo Express, Mongo

54
00:03:48,560 --> 00:03:52,040
front end and API containers were stopped.

55
00:03:52,070 --> 00:03:54,080
Now there are no containers running.

56
00:03:54,080 --> 00:03:57,380
And now let's bring them up again using command docker.

57
00:03:57,380 --> 00:04:00,800
Compose up with option D detached.

58
00:04:01,800 --> 00:04:02,580
Let's do that.

59
00:04:02,700 --> 00:04:08,970
Now, there is no need to pull new images for Mongo and Mongo Express because they are already present

60
00:04:08,970 --> 00:04:10,350
locally in Docker cache.

61
00:04:10,380 --> 00:04:16,980
That's why it makes sense only to start new containers and that's what Docker does here on those lines.

62
00:04:17,010 --> 00:04:19,050
Starting all four containers.

63
00:04:19,230 --> 00:04:21,149
Containers were started.

64
00:04:21,180 --> 00:04:22,220
Here they are.

65
00:04:22,230 --> 00:04:25,220
And now let's actually explore those containers.

66
00:04:25,230 --> 00:04:30,870
And first, after the small pause, let me explain to you how to get information about containers using

67
00:04:30,870 --> 00:04:32,980
Docker desktop dashboard.

68
00:04:33,000 --> 00:04:33,900
This one.

69
00:04:34,080 --> 00:04:35,910
I'll see you guys just in a moment.

