1 00:00:00,000 --> 00:00:04,200 [Intro Music] 2 00:00:04,200 --> 00:00:05,820 In this practical chapter, you'll 3 00:00:05,820 --> 00:00:07,890 learn how to Dockerize applications 4 00:00:07,890 --> 00:00:11,001 that consists of several microservices, 5 00:00:11,001 --> 00:00:12,150 you'll learn how to 6 00:00:12,150 --> 00:00:14,550 create Dockerfiles, and how to run 7 00:00:14,580 --> 00:00:16,680 different services using 'docker- 8 00:00:16,680 --> 00:00:18,600 compose'. And in order to get 9 00:00:18,600 --> 00:00:20,790 started, you have to get the 10 00:00:20,790 --> 00:00:22,920 initial version of the project that 11 00:00:22,920 --> 00:00:24,270 is located in the 'docker' 12 00:00:24,270 --> 00:00:26,700 repository. It is primary repository 13 00:00:26,700 --> 00:00:28,680 for this Docker course. And there 14 00:00:28,680 --> 00:00:31,140 is folder called 'images-gallery', 15 00:00:31,200 --> 00:00:33,870 here it this. So please clone 16 00:00:33,900 --> 00:00:36,540 'docker' repository from my GitHub 17 00:00:36,570 --> 00:00:38,940 account. And if you have already 18 00:00:38,940 --> 00:00:40,950 cloned it, you have to pull 19 00:00:41,010 --> 00:00:43,680 updates in order to get this 20 00:00:43,710 --> 00:00:45,240 images-gallery folder to your 21 00:00:45,240 --> 00:00:47,790 computers. I don't have such 22 00:00:47,820 --> 00:00:49,710 'docker' folder on this computer, 23 00:00:49,800 --> 00:00:51,840 that's why let me go ahead and 24 00:00:51,840 --> 00:00:54,780 clone entire repository. Go to 'Code', 25 00:00:54,810 --> 00:00:56,760 and click on this icon in order to 26 00:00:56,760 --> 00:00:59,490 copy remote repository URL in 27 00:00:59,490 --> 00:01:02,550 HTTPS format. Let me copy it. And 28 00:01:02,550 --> 00:01:03,900 now let me clone the remote 29 00:01:03,900 --> 00:01:05,910 repository to local computer using 30 00:01:05,940 --> 00:01:08,430 'git clone' command. And I'll do that 31 00:01:08,460 --> 00:01:10,950 in the terminal. I'll use iTerm2 32 00:01:10,980 --> 00:01:13,110 application on Mac, on Windows you 33 00:01:13,110 --> 00:01:15,390 could use PowerShell. Here, I 34 00:01:15,390 --> 00:01:16,800 already changed directory to 35 00:01:16,800 --> 00:01:18,750 Desktop. You could clone remote 36 00:01:18,750 --> 00:01:20,640 repository to any location on your 37 00:01:20,640 --> 00:01:23,130 computer as you wish. I'll clone it 38 00:01:23,130 --> 00:01:25,080 to the Desktop. And here I'll enter 39 00:01:25,080 --> 00:01:28,020 'git clone', and paste copied URL, 40 00:01:28,500 --> 00:01:31,140 'https://github.com/bstashchuk', it's my GitHub 41 00:01:31,140 --> 00:01:33,210 username; and 'docker' is name 42 00:01:33,240 --> 00:01:35,280 of the remote repository. Let's go 43 00:01:35,280 --> 00:01:37,680 ahead and clone it. Cloning into 44 00:01:37,680 --> 00:01:41,070 Docker. And now if I list files and 45 00:01:41,070 --> 00:01:43,350 folders in the 'docker' folder, I'll 46 00:01:43,350 --> 00:01:45,420 see two sub-folders - containers, 47 00:01:45,480 --> 00:01:48,930 images-gallery, and readme.md. images- 48 00:01:48,930 --> 00:01:51,360 gallery folder is that folder that 49 00:01:51,360 --> 00:01:52,980 we are interested in in this 50 00:01:52,980 --> 00:01:55,650 chapter. And now we have to open 51 00:01:55,680 --> 00:01:58,140 exactly this folder in the Visual 52 00:01:58,140 --> 00:02:00,300 Studio Code. You could do that in 53 00:02:00,300 --> 00:02:02,970 following ways - either 'cd' to 54 00:02:03,000 --> 00:02:06,330 'docker/images-gallery', and here 55 00:02:06,330 --> 00:02:08,820 and enter 'code.' in order to open 56 00:02:08,910 --> 00:02:11,370 current folder, images-gallery in 57 00:02:11,370 --> 00:02:13,259 the Visual Studio Code. If this 58 00:02:13,259 --> 00:02:14,280 command doesn't work on your 59 00:02:14,280 --> 00:02:15,420 computer, in a moment, I'll 60 00:02:15,420 --> 00:02:16,920 demonstrate to you how to open 61 00:02:16,920 --> 00:02:18,840 specific folder directly from VS 62 00:02:18,840 --> 00:02:21,270 Code. I'll do that using 'code' command. 63 00:02:21,600 --> 00:02:22,600 Let me go ahead. 64 00:02:22,600 --> 00:02:24,400 [no audio] 65 00:02:24,400 --> 00:02:27,500 And here I see that images-gallery folder was 66 00:02:27,540 --> 00:02:29,190 successfully opened in the Visual 67 00:02:29,190 --> 00:02:31,740 Studio Code. If such command didn't 68 00:02:31,740 --> 00:02:33,690 work for you, you could always go 69 00:02:33,690 --> 00:02:36,870 to File, Open, and navigate to 70 00:02:36,870 --> 00:02:38,700 location of the images-gallery 71 00:02:38,700 --> 00:02:41,820 folder, select it like that, and then 72 00:02:41,820 --> 00:02:45,090 click Open. Alright, now here in 73 00:02:45,090 --> 00:02:47,160 this images-gallery folder, there 74 00:02:47,160 --> 00:02:49,380 are two sub-folders, basically three 75 00:02:49,380 --> 00:02:52,151 sub-folders. One has settings.json 76 00:02:52,151 --> 00:02:53,910 file for Visual Studio Code, 77 00:02:54,240 --> 00:02:56,880 but the primary folders are 'api' and 78 00:02:56,880 --> 00:02:59,160 'frontend'. And those two folders 79 00:02:59,190 --> 00:03:02,650 represent two different microservices. 80 00:03:02,650 --> 00:03:04,680 Frontend application is 81 00:03:04,710 --> 00:03:07,230 React JavaScript application. And 82 00:03:07,230 --> 00:03:09,390 if you go to package.json file, 83 00:03:09,570 --> 00:03:10,890 you will find here such 84 00:03:10,890 --> 00:03:14,670 dependency as 'react'. And API 85 00:03:14,700 --> 00:03:17,650 application is written using Python, 86 00:03:17,650 --> 00:03:19,200 and primary package that is 87 00:03:19,200 --> 00:03:22,230 utilized here is Python Flask. And 88 00:03:22,230 --> 00:03:24,690 if you go to 'Pipfile' here, you'll 89 00:03:24,690 --> 00:03:27,120 find such package here on the list. 90 00:03:27,390 --> 00:03:28,860 With help of Python 'flask', you 91 00:03:28,860 --> 00:03:31,080 could very easily create backend 92 00:03:31,110 --> 00:03:33,540 API service for your frontend 93 00:03:33,570 --> 00:03:36,210 applications. That's quick overview 94 00:03:36,240 --> 00:03:38,820 of those two microservices and 95 00:03:38,820 --> 00:03:40,590 next after a small pause let me 96 00:03:40,590 --> 00:03:43,400 explain to you how those microservices 97 00:03:43,400 --> 00:03:44,500 actually communicate with 98 00:03:44,550 --> 00:03:46,470 each other, and what such images- 99 00:03:46,470 --> 00:03:48,390 gallery application actually does. 100 00:03:48,600 --> 00:03:50,010 See you just in a moment. 101 00:03:50,010 --> 00:03:52,170 [no audio]