1
00:00:04,450 --> 00:00:10,510
We have just successfully agreed that the small Express Web seller application is using Lord Jesus and

2
00:00:10,510 --> 00:00:13,210
we have executed this application.

3
00:00:13,330 --> 00:00:19,390
And before that we have installed some additional packages namely express package along with is dependencies

4
00:00:19,630 --> 00:00:25,980
using npm install command and all of that we have are from inside of the node GSA container.

5
00:00:25,990 --> 00:00:32,530
There was no beam or node running on our local computer but now there was a challenge for us and you'll

6
00:00:32,530 --> 00:00:39,500
see that our application is not terminated when we press key combination control C and when seek in

7
00:00:39,550 --> 00:00:46,600
signal is sent to our node Jesus brought us it is sent directed to our process and notice that in this

8
00:00:46,600 --> 00:00:53,230
command we have actually overridden default command does node command using custom command and we run

9
00:00:53,330 --> 00:01:00,370
in the largest file using Node interpreter and we have also mapped port of our Express application and

10
00:01:00,370 --> 00:01:06,280
we have exposed it to external port three thousand and we have also used the custom rocking directory

11
00:01:06,580 --> 00:01:12,580
and we have mapped our local folder using this option and we have mapped to this folder to our folder

12
00:01:12,790 --> 00:01:14,470
inside of the container.

13
00:01:14,470 --> 00:01:20,980
Great lesson on what if I built our application and left at handling of the seek in signal.

14
00:01:20,980 --> 00:01:26,170
I want to show you that that because it is important for understanding of how we are actually connected

15
00:01:26,380 --> 00:01:28,630
to node brought us using Docker.

16
00:01:29,200 --> 00:01:35,980
Let's go to our tiny application here and let's open up in the just file located in the Express folder.

17
00:01:35,980 --> 00:01:42,160
Let me hide this left pane and let's add additional baggage here and it is actually default baggage.

18
00:01:42,160 --> 00:01:48,910
No just package gold brought us and afterwards we will use this package for handling of the seek in

19
00:01:49,000 --> 00:01:49,740
signal.

20
00:01:49,800 --> 00:01:50,530
Let's do it.

21
00:01:50,620 --> 00:01:59,180
Let's require additional package guns to process or require process like so and next.

22
00:01:59,200 --> 00:02:07,800
For example here let's add following glance brought us on and here throws to argument will be sig int.

23
00:02:08,110 --> 00:02:10,020
And second will be callback function.

24
00:02:10,030 --> 00:02:12,520
I'll use our all function expression syntax again.

25
00:02:12,610 --> 00:02:16,660
If you don't know no just syntax and don't know javascript please.

26
00:02:16,690 --> 00:02:17,710
Never mind.

27
00:02:17,710 --> 00:02:23,560
I want to just show you how you are able to handle seek in signal inside of the broadcast inside of

28
00:02:23,560 --> 00:02:24,520
the container.

29
00:02:24,520 --> 00:02:31,510
Okay let's add here our functional syntax like so and here inside of this are all function letters the

30
00:02:31,510 --> 00:02:32,200
following.

31
00:02:32,200 --> 00:02:34,220
Let's bring to the terminal message.

32
00:02:34,360 --> 00:02:43,230
Application is being terminated through doors like so and here on the next line let's exit from the

33
00:02:43,230 --> 00:02:49,190
process using the following syntax brought us exit and he'll let's call this method of the process until

34
00:02:49,190 --> 00:02:55,560
it's past single argument 0 and it will mean that this process will terminate correct it with exit code

35
00:02:55,650 --> 00:02:56,380
0.

36
00:02:56,430 --> 00:02:59,810
Let's add one more line break here like so.

37
00:02:59,850 --> 00:03:05,550
And that's actually all that we need to modify in our application to handle seek in signal.

38
00:03:05,550 --> 00:03:07,140
Let's save this file.

39
00:03:07,140 --> 00:03:13,560
Let's go to our terminal and actually we need to stop this container thrust and afterwards run it or

40
00:03:13,920 --> 00:03:16,910
let's go here and let's at least contain the rules.

41
00:03:17,090 --> 00:03:22,740
Yes and no let's use Docker Q command in order to quickly terminate brought inside of the container

42
00:03:22,770 --> 00:03:27,230
because our application does not react to seek down comment as well.

43
00:03:27,250 --> 00:03:32,920
Let's end our dock our keel and here we'll be at one view and container was terminated.

44
00:03:33,270 --> 00:03:37,920
Let's go back to the step and let's rail run our application using same command.

45
00:03:38,250 --> 00:03:45,030
And of course no our changes made in this file will be taken into account and our application should

46
00:03:45,030 --> 00:03:47,610
now react to this signal.

47
00:03:47,640 --> 00:03:55,180
Actually let me replace terminated with interrupted here because we actually interrupt our process.

48
00:03:55,200 --> 00:04:00,740
Let's go back to the step and less around this comment and no this breath controls.

49
00:04:01,350 --> 00:04:05,960
And now our process was terminated an icy text application is being terminated.

50
00:04:06,120 --> 00:04:09,490
Basically it seems that I have to save the file.

51
00:04:09,540 --> 00:04:16,589
Yes that is a case let's save it and also let's add the handling of the sick term signal into our application

52
00:04:16,649 --> 00:04:17,180
as well.

53
00:04:17,370 --> 00:04:26,340
Let me a copy of this blog based to here and here will be seek DRM and with those lines in place we

54
00:04:26,340 --> 00:04:32,580
will be able also to use Docker stop comment that will quickly stop corresponding protest inside of

55
00:04:32,580 --> 00:04:37,770
the container and TR lets that type application is being terminated.

56
00:04:37,770 --> 00:04:43,560
Like so let's save this and let's now go back to our application here.

57
00:04:43,590 --> 00:04:50,400
Let's clear a terminal and let's run our application control see I see application is being interrupted

58
00:04:50,670 --> 00:04:56,010
and now process was terminated of course and there are no containers currently running Docker.

59
00:04:56,430 --> 00:04:58,890
Yes and yes there is a case.

60
00:04:58,980 --> 00:05:02,010
Let's run our container once again.

61
00:05:02,250 --> 00:05:04,020
This actually brand new container.

62
00:05:04,020 --> 00:05:10,800
And no let's go to the step daughter piece and let us know use Docker or stop command in order to Samp

63
00:05:10,860 --> 00:05:14,770
seek term signal to our not just process Docker.

64
00:05:14,820 --> 00:05:15,470
Stop.

65
00:05:15,510 --> 00:05:22,340
And here let's use thrust of your characters off container iodine C1 and now container was stopped breeding

66
00:05:22,340 --> 00:05:22,850
weekly.

67
00:05:23,010 --> 00:05:28,280
And that's because we have adult handling of sick time signal to our obligation.

68
00:05:28,290 --> 00:05:34,080
That's all for this lecture where I demonstrated you how you able to at handling of the sick and the

69
00:05:34,080 --> 00:05:37,080
sick time signals to your application.

70
00:05:37,080 --> 00:05:43,640
And again we are required to do so because we have connected directly to North GSK process after entering

71
00:05:43,890 --> 00:05:46,460
such kind of comment node in the Lord Jesus.

72
00:05:46,500 --> 00:05:54,670
We launch a specific file using Node interpreter and that's why we connect directly to node GSK process.

73
00:05:54,870 --> 00:06:01,980
And actually I approved using those the lines of code that when you press control see Docker sends sick

74
00:06:02,070 --> 00:06:08,760
ind signal to corresponding process and if you use Docker I'll stop comment Docker sends sick term signal

75
00:06:08,820 --> 00:06:10,740
to corresponding process.

76
00:06:10,740 --> 00:06:11,830
That's all for this show.

77
00:06:11,850 --> 00:06:13,090
I hope that you enjoyed it.

78
00:06:13,110 --> 00:06:18,720
And next you'll get a small challenge and you will need to create tiny nor yes application yourself.

79
00:06:18,720 --> 00:06:19,740
I'll see you next.

80
00:06:19,760 --> 00:06:20,100
Bye bye.

