A technical tutorial demonstrating how to dockerize a NestJS reservations application. The process includes creating a multi-stage Dockerfile, configuring Docker Compose to manage the application and a MongoDB database, and implementing environment variables to allow containers to communicate successfully.
Length 13:35
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #docker #docker-compose #microservices #nodejs #mongodb #development #containerization #coding #tutorial
0:00 Okay, so we're ready to start actually creating 0:02 additional 0:03 microservices, in this case, the authentication microservice. 0:07 However, before we go ahead and do that, I wanna actually start 0:11 dockerizing our existing reservations 0:14 application. And the reason for this is because when we have to run multiple 0:18 applications at once, I wanna take advantage of Docker Compose 0:23 to be able to run multiple images at once. 0:26 So let's go ahead and get started in dockerizing our 0:29 application. 0:30 So this is a pretty straightforward process. 0:32 Of course, you need to make sure you have Docker 0:34 installed on your machine. 0:36 You of course need to make sure you have Docker installed on your machine, 0:40 which of course I'll have a separate video going over how to set 0:44 up and install. Assuming you have Docker already set up, 0:48 I'm 0:48 gonna go into the reservations folder, and in the root folder, 0:52 I'm gonna create a new file here called a Docker 0:56 file. Docker file is responsible for the 0:59 instructions on how to actually build the 1:03 application. You can think of it almost as like a 1:06 template. 1:07 So we're gonna provide the template for how to build the application and 1:11 actually create the container that we want to run. 1:15 So in Docker, we can actually extend preexisting 1:19 images using the from keyword. So this is gonna be the base 1:23 image we want to extend from. So I wanna use the node 1:27 alpine image, which is a base alpine image that 1:31 already has node inside of it, and which of course we're gonna need to run 1:35 our application. So I'm gonna label this base image 1:38 development because we're gonna break up the stages of 1:42 this image into two different stages. The first will be development. 1:47 Next, I'm gonna set the working directory for 1:50 our container to be in
The rest of the transcript is for members.
Sign in