All right my friends let's start doing some setup for our tickets service.
So like I said we're gonna be copy pasting a lot of stuff over from the off service.
So let's get to it.
Back inside of my editor I got to find my root project directory and I'll create a new folder inside
there called simply tickets and I'm going to zoom in a little bit so you can see what I'm about to do
very easily inside of tickets.
I can expand nothing.
I'm also going to expand off then inside the service.
I'm going to a multi select t s config package Chase on package like Docker file and the DOT Docker
ignore file and then going to copy all five of those files and I'm going to paste all of them into tickets
then inside of tickets I'm going to make a new directory called s RC I'm going to go back up to the
OTT service I'll expand SLC inside of their and out of this s our C directory all we want to get is
index t s apt yes and a test directory song and a multi select those three things I'm going to copy
all those will then collapse off I'm gonna go down to tickets and paste everything inside their
and that's pretty much it we're not gonna go through our tickets directory we're gonna find a couple
places where we still have some references back to the OTT service we're gonna make sure that we just
replace any words referring to all service with tickets just to make sure it's really clear oh yeah
this is the package based on file for tickets and so on.
Let's do our offer inside of Docker ignore.
Nothing inside there.
How about the docker file.
Nothing specific about auth inside of here.
About package stuff.
Jason.
Well the package Jason File we've got a name of off let's update that two tickets instead.
Then let's go inside the SRT directory to find indexed t T.S. inside of here we've got a couple of different
errors.
That's just because we have not installed any dependencies into this process into this project just
yet.
So we'll ignore those errors right now.
It looks like there is a direct connection string right here to connect to our.
Off Mongo instance.
So we'll have to update that.
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
there about in the apt.
Yes file inside of here.
We've got a lot of references to some routers that do not exist inside of our tickets project.
It's going to delete those right away just so I don't forget I'll then go down to where we had wired
those things up to our Express application and delete that as well if you see any errors inside of here
where I don't see pretty much anything that appears to be wrong inside of here.
Don't sweat it.
A lot of errors will go away as soon as we start to install dependencies I'm going to close the apt
yes file one last location let's check really quickly inside the test folder I'm going to take a look
at setup.
Yes and so inside of here.
Well I don't really see too much inside of your thumb all that worried about I do some see some stuff
about sine and done here at the bottom though we might have to update but for the most part I think
we could probably just leave all this as this okay.
So let's go back over toward terminal.
We're going to install dependencies inside of this ticket's folder.
Naturally we could have copied over the node modules directory itself but I'm just gonna install dependencies
manually.
No reason not to go inside tickets.
I'll do an npm install.
Simple enough.
All right.
So like I said definitely saved ourselves a lot of time that would've been about an hour of writing
out all that stuff from scratch if we had to so let's finish up this video by building our image and
pushing it off to Docker Hub to back of my terminal.
Oh look at that.
We have to wait once again for Mongo DB memory to be installed.
Like I said that's why we added nothing to the development dependencies list so we don't have to download
that thing every single time that we tried to redeploy our image.
All right.
I'm gonna open up a second terminal window inside of tickets inside of here.
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
a dot
doing the installation should only take a moment or so since we've got that only pride flag on there
which means we do not have to install or download and install that Mongo DB memory binary which means
we're saving 80 megabytes off this install process.
So it's gonna give the second to finish up and once it's all done like I said it first can make sure
that we push this off to Docker Hub.
Now if you're curious why we do this in general it's because when we try to run scaffold which is something
we're going to be doing in a little bit scaffold is gonna try to reach out to Docker Hub to get an initial
copy of this image to pull down.
That's kind of assumption scaffold assumes that you've already built this image once in the past.
That's why we're going through the separate build image and push to Docker have process as a reminder
if you are running your project on Google Cloud you do not have to do this step.
Probably should've mentioned that before I ran the command but that's like it looks like we're all built
I'll do a docker push demon Greider tickets and that's going to push our image up.
All right well that's pretty much it.
We're gonna take a quick pause right here.
Let's continue the next video.
We're gonna start right out that Cuban Eddie's deployment file and all this other stuff.