1
00:00:04,540 --> 00:00:10,180
I just made a quick overview of the Moon and Moon Express official Docker images, and now it's time

2
00:00:10,180 --> 00:00:17,620
to create additional services in our own Docker compose file and add their Mongo and Monaco Express

3
00:00:17,620 --> 00:00:20,320
services in order to save some time.

4
00:00:20,440 --> 00:00:26,200
Let's simply grab those lines from this example and insult them to the Docker compose file.

5
00:00:26,470 --> 00:00:31,480
Let's go there, and let's insert those services below API here.

6
00:00:31,810 --> 00:00:38,980
Make sure that you go to the same level as API and front end services here in this Yamal file and based

7
00:00:39,010 --> 00:00:43,210
corporate lines like that, and make sure that formatting is correct.

8
00:00:43,840 --> 00:00:46,300
And let's, of course, make some adjustments here.

9
00:00:46,810 --> 00:00:54,790
There also is Mongo and the hear whispers if I image and it means for Docker that we want to use official

10
00:00:54,790 --> 00:00:58,510
image from the Docker hop hero's name or such image.

11
00:00:58,960 --> 00:01:03,400
And if you want, you could also at Caltech lead us, but we will admit it.

12
00:01:03,490 --> 00:01:06,640
In such case, Docker will attack latest automatically.

13
00:01:07,090 --> 00:01:09,550
Let's keep or start always here and here.

14
00:01:09,760 --> 00:01:11,170
Same as in the example.

15
00:01:11,290 --> 00:01:17,050
In such case, Docker will restart containers automatically in case of any failures and environment.

16
00:01:17,050 --> 00:01:20,140
Variables here will be kept, as you'll see here.

17
00:01:20,350 --> 00:01:28,990
But let's change this example password to a NAS, or let's say, very this strong db, this password

18
00:01:29,260 --> 00:01:29,770
like that.

19
00:01:30,250 --> 00:01:36,010
And also, let's take this password and insert it here instead of this example password.

20
00:01:36,400 --> 00:01:43,660
Also here in Mongo Express section, let's add one more environment variable gold and eve underscore

21
00:01:43,660 --> 00:01:52,180
config underscore MongoDB under a scroll etc column and well, you will be Mongo.

22
00:01:52,750 --> 00:01:59,800
He does name of the Mongo service here, and I told you in the previous lecture that such Mongo hostname

23
00:01:59,800 --> 00:02:06,520
instead was a Docker will be resolved by DNS of the Docker to correspondent IP address of the running

24
00:02:06,520 --> 00:02:10,180
container container that will be running Mongo servers.

25
00:02:10,509 --> 00:02:12,880
And of course, I'll show you how it looks from inside.

26
00:02:13,480 --> 00:02:17,980
Also here you see both mapping and internal brought.

27
00:02:18,050 --> 00:02:25,900
A Dubon inside of the Mongo Express is mapped to external brought on your computer aided 12:52, and

28
00:02:25,900 --> 00:02:32,020
that means that you will be able to access graphical user interface of the Mongo Express because it

29
00:02:32,020 --> 00:02:38,950
has actually it is based on the express and more, and it means that you will be able to access it in

30
00:02:38,950 --> 00:02:43,810
any web browser using local host Golden 88 to one address.

31
00:02:44,590 --> 00:02:48,520
But notice that Mongo doesn't have any exposed ports.

32
00:02:49,150 --> 00:02:52,300
It doesn't mean that the Mongo does not utilize ports.

33
00:02:52,330 --> 00:02:56,650
Of course, it uses corresponding ports in order to be able to accept incoming requests.

34
00:02:57,610 --> 00:03:02,620
But Mongo will not be exposed to outside world.

35
00:03:02,920 --> 00:03:10,540
It will be available only from all the containers, for example, from one express or from API.

36
00:03:11,050 --> 00:03:17,890
Because usually eBay's servers communicate directly with databases, and the Noah Project API container

37
00:03:18,010 --> 00:03:25,570
should interact with Mongo container, and it is possible inside of the Docker using Mongo as a hostname

38
00:03:25,600 --> 00:03:26,850
of the Mongo container.

39
00:03:28,010 --> 00:03:35,660
And again, there was no need to expose Mongeau to outside world and to add for something Mongeau Express

40
00:03:35,660 --> 00:03:38,180
will communicate with Mongeau internally.

41
00:03:39,470 --> 00:03:39,850
All right.

42
00:03:40,200 --> 00:03:45,630
That's actually all configuration that needs to be done in order to bring up two additional services,

43
00:03:45,900 --> 00:03:53,280
mourn and mourn, Go Express and basically let me add one more instruction here and to scold depends

44
00:03:53,940 --> 00:04:01,770
on underscore on and with such instruction in place, you could at least of the containers that current

45
00:04:01,770 --> 00:04:03,600
container depends on.

46
00:04:04,200 --> 00:04:09,570
And with such configuration, if you enter here, for instance, Morning Good Morning Express container

47
00:04:09,600 --> 00:04:13,960
will be started by Docker only after start of the morning.

48
00:04:13,960 --> 00:04:17,610
The container that's what depends on instruction means.

49
00:04:18,329 --> 00:04:20,329
That's why let's give this instruction here.

50
00:04:20,579 --> 00:04:26,880
We want to start Moonglow Express after Mongo and let's say changes here in this Docker compose file.

51
00:04:27,360 --> 00:04:32,880
Now there are four different services front and API Mongo and Mongo Express.

52
00:04:33,900 --> 00:04:40,020
Let's not go ahead and using Docker compose up command, bring up those two additional services.

53
00:04:40,290 --> 00:04:42,330
But let's do that, of course, after the small balls.

