1 00:00:00,830 --> 00:00:04,260 All right my friends let's start doing some setup for our tickets service. 2 00:00:04,260 --> 00:00:08,200 So like I said we're gonna be copy pasting a lot of stuff over from the off service. 3 00:00:08,230 --> 00:00:09,350 So let's get to it. 4 00:00:09,580 --> 00:00:14,080 Back inside of my editor I got to find my root project directory and I'll create a new folder inside 5 00:00:14,080 --> 00:00:19,500 there called simply tickets and I'm going to zoom in a little bit so you can see what I'm about to do 6 00:00:19,560 --> 00:00:21,980 very easily inside of tickets. 7 00:00:21,990 --> 00:00:23,180 I can expand nothing. 8 00:00:23,280 --> 00:00:27,420 I'm also going to expand off then inside the service. 9 00:00:27,520 --> 00:00:34,170 I'm going to a multi select t s config package Chase on package like Docker file and the DOT Docker 10 00:00:34,180 --> 00:00:41,620 ignore file and then going to copy all five of those files and I'm going to paste all of them into tickets 11 00:00:45,250 --> 00:00:51,450 then inside of tickets I'm going to make a new directory called s RC I'm going to go back up to the 12 00:00:51,450 --> 00:00:58,680 OTT service I'll expand SLC inside of their and out of this s our C directory all we want to get is 13 00:00:59,010 --> 00:01:07,080 index t s apt yes and a test directory song and a multi select those three things I'm going to copy 14 00:01:07,080 --> 00:01:14,400 all those will then collapse off I'm gonna go down to tickets and paste everything inside their 15 00:01:17,400 --> 00:01:22,940 and that's pretty much it we're not gonna go through our tickets directory we're gonna find a couple 16 00:01:22,960 --> 00:01:27,660 places where we still have some references back to the OTT service we're gonna make sure that we just 17 00:01:27,660 --> 00:01:32,130 replace any words referring to all service with tickets just to make sure it's really clear oh yeah 18 00:01:32,160 --> 00:01:35,670 this is the package based on file for tickets and so on. 19 00:01:35,700 --> 00:01:37,820 Let's do our offer inside of Docker ignore. 20 00:01:37,830 --> 00:01:38,820 Nothing inside there. 21 00:01:38,840 --> 00:01:40,160 How about the docker file. 22 00:01:40,230 --> 00:01:42,460 Nothing specific about auth inside of here. 23 00:01:42,630 --> 00:01:43,400 About package stuff. 24 00:01:43,410 --> 00:01:44,450 Jason. 25 00:01:44,520 --> 00:01:53,730 Well the package Jason File we've got a name of off let's update that two tickets instead. 26 00:01:53,910 --> 00:01:59,760 Then let's go inside the SRT directory to find indexed t T.S. inside of here we've got a couple of different 27 00:01:59,760 --> 00:02:00,240 errors. 28 00:02:00,240 --> 00:02:04,560 That's just because we have not installed any dependencies into this process into this project just 29 00:02:04,560 --> 00:02:05,610 yet. 30 00:02:05,610 --> 00:02:07,480 So we'll ignore those errors right now. 31 00:02:08,490 --> 00:02:12,030 It looks like there is a direct connection string right here to connect to our. 32 00:02:12,030 --> 00:02:14,070 Off Mongo instance. 33 00:02:14,070 --> 00:02:15,090 So we'll have to update that. 34 00:02:15,090 --> 00:02:19,990 Let's just keep that in the back of our head for a moment and I don't see it too much other stuff inside 35 00:02:19,990 --> 00:02:21,310 there about in the apt. 36 00:02:21,330 --> 00:02:23,040 Yes file inside of here. 37 00:02:23,050 --> 00:02:28,500 We've got a lot of references to some routers that do not exist inside of our tickets project. 38 00:02:28,550 --> 00:02:35,230 It's going to delete those right away just so I don't forget I'll then go down to where we had wired 39 00:02:35,230 --> 00:02:42,260 those things up to our Express application and delete that as well if you see any errors inside of here 40 00:02:42,410 --> 00:02:45,950 where I don't see pretty much anything that appears to be wrong inside of here. 41 00:02:45,950 --> 00:02:46,810 Don't sweat it. 42 00:02:46,820 --> 00:02:52,230 A lot of errors will go away as soon as we start to install dependencies I'm going to close the apt 43 00:02:52,260 --> 00:02:57,770 yes file one last location let's check really quickly inside the test folder I'm going to take a look 44 00:02:57,770 --> 00:02:58,240 at setup. 45 00:02:58,280 --> 00:03:01,500 Yes and so inside of here. 46 00:03:01,560 --> 00:03:08,120 Well I don't really see too much inside of your thumb all that worried about I do some see some stuff 47 00:03:08,120 --> 00:03:11,690 about sine and done here at the bottom though we might have to update but for the most part I think 48 00:03:11,690 --> 00:03:14,680 we could probably just leave all this as this okay. 49 00:03:14,750 --> 00:03:16,720 So let's go back over toward terminal. 50 00:03:16,760 --> 00:03:20,270 We're going to install dependencies inside of this ticket's folder. 51 00:03:20,270 --> 00:03:26,540 Naturally we could have copied over the node modules directory itself but I'm just gonna install dependencies 52 00:03:26,540 --> 00:03:27,270 manually. 53 00:03:27,380 --> 00:03:30,990 No reason not to go inside tickets. 54 00:03:30,980 --> 00:03:31,940 I'll do an npm install. 55 00:03:31,980 --> 00:03:34,440 Simple enough. 56 00:03:34,490 --> 00:03:34,910 All right. 57 00:03:34,910 --> 00:03:39,380 So like I said definitely saved ourselves a lot of time that would've been about an hour of writing 58 00:03:39,380 --> 00:03:45,340 out all that stuff from scratch if we had to so let's finish up this video by building our image and 59 00:03:45,340 --> 00:03:49,450 pushing it off to Docker Hub to back of my terminal. 60 00:03:49,630 --> 00:03:50,390 Oh look at that. 61 00:03:50,390 --> 00:03:53,830 We have to wait once again for Mongo DB memory to be installed. 62 00:03:53,960 --> 00:03:58,580 Like I said that's why we added nothing to the development dependencies list so we don't have to download 63 00:03:58,580 --> 00:04:03,000 that thing every single time that we tried to redeploy our image. 64 00:04:03,000 --> 00:04:03,210 All right. 65 00:04:03,230 --> 00:04:08,020 I'm gonna open up a second terminal window inside of tickets inside of here. 66 00:04:08,020 --> 00:04:15,460 I'll try to build my image so I can do a docker build dash t by dock or I.D. flash tickets and then 67 00:04:15,460 --> 00:04:15,840 a dot 68 00:04:18,630 --> 00:04:22,800 doing the installation should only take a moment or so since we've got that only pride flag on there 69 00:04:23,040 --> 00:04:28,710 which means we do not have to install or download and install that Mongo DB memory binary which means 70 00:04:28,710 --> 00:04:31,680 we're saving 80 megabytes off this install process. 71 00:04:31,680 --> 00:04:35,310 So it's gonna give the second to finish up and once it's all done like I said it first can make sure 72 00:04:35,310 --> 00:04:37,630 that we push this off to Docker Hub. 73 00:04:37,660 --> 00:04:42,150 Now if you're curious why we do this in general it's because when we try to run scaffold which is something 74 00:04:42,150 --> 00:04:46,560 we're going to be doing in a little bit scaffold is gonna try to reach out to Docker Hub to get an initial 75 00:04:46,560 --> 00:04:48,510 copy of this image to pull down. 76 00:04:48,510 --> 00:04:52,210 That's kind of assumption scaffold assumes that you've already built this image once in the past. 77 00:04:52,290 --> 00:04:56,820 That's why we're going through the separate build image and push to Docker have process as a reminder 78 00:04:56,880 --> 00:05:00,720 if you are running your project on Google Cloud you do not have to do this step. 79 00:05:00,720 --> 00:05:06,810 Probably should've mentioned that before I ran the command but that's like it looks like we're all built 80 00:05:07,300 --> 00:05:15,230 I'll do a docker push demon Greider tickets and that's going to push our image up. 81 00:05:15,560 --> 00:05:17,000 All right well that's pretty much it. 82 00:05:17,150 --> 00:05:18,940 We're gonna take a quick pause right here. 83 00:05:18,950 --> 00:05:20,180 Let's continue the next video. 84 00:05:20,270 --> 00:05:24,070 We're gonna start right out that Cuban Eddie's deployment file and all this other stuff.