I was struggling to understand the actual responsibility of the docker, how to use it and so on... but now, I think I am in love with docker. Thank you very much!!!!
Thanks a lot Anson. You have an extra ordinary talent in teaching and explaining topics. Keep up the amazing work and looking forward to seeing more of your content. Cheers.
If anyone is facing the trouble " Error: Cannot find module '/usr/src/app/dist/main " . You can change the start:prod script in package.json to: "start:prod": "node dist/src/main", it is because the main file inside the container is inside the /usr/src/app/dist/src/main> I don't know the reason behind this. It must be something related to the tsconfig file. If you go check the files under the container the main file is in /usr/src/app/dist/src/main so, that works. Basically you need to provide the path of the main.js file of your container in your package.json file. If you try to build the application without docker ( in terminal ) after changing the path it won't work again because in dev environment the main file is inside the dist/ folder so hope you got the drill.
Whats the difference in RUN and CMD command? if command like this `RUN npm run build` is possible then why added `CMD [ "npm", "run", "start:prod" ]` why not `RUN npm run start:prod`?
hello anson . thanks for this video . im following your video but im having a problem on the hot reload on the tsconfig.json its not working . im using the latest typescript version on the dev dependencies
I would double check the volumes and make sure they are mounted correctly. If you're on Windows make sure the watchOptions in the tsconfig is configured correctly... Here's a Stack Overflow link that may help - stackoverflow.com/questions/74815121/why-is-hot-reloading-not-working-in-my-nestjs-docker-compose-multistage-project
@@ansonthedev thanks for this anson ! started watching all of your nest js videos because im starting to a new company and nest js is one of their stack ! . really love the way you teach to code its like watching traversy media . again thank you !
I am getting Error: Cannot find module '/src/nest/dist/main' my dockerfile FROM node:alpine WORKDIR /src/nest COPY package*.json . RUN npm install -g @nestjs/cli RUN npm install COPY . . EXPOSE 3000 CMD [ "npm","run","start:dev" ] docker-compose.yaml version: '2.24.3' services: server: container_name: server build: context: ./nest dockerfile: Dockerfile ports: - "3000:3000" volumes: - ./nest/src:/src/nest/src can anyone help me on this ?
The explanation on mounting the /src finally made it clear for me on how to develop locally with Docker. Thanks a lot.
I was struggling to understand the actual responsibility of the docker, how to use it and so on... but now, I think I am in love with docker. Thank you very much!!!!
Thanks a lot Anson. You have an extra ordinary talent in teaching and explaining topics. Keep up the amazing work and looking forward to seeing more of your content. Cheers.
the best dockerize video i have ever seen. Thank you so much Anson for this straight forward and clean explanation👍👍
Thank you brother. Love this
Very clear and concise video on dockerizing nestjs app, thanks so much!
I love this tutorial. So straight to the point! Thank you! 🎉
Thank you so much for another solid tutorial Anson. I was toying with the idea of looking into Docker.
WOW! Super underated video this gotta have a million views this is gold!
Excellent video. JB
thanks a million, awesome explanation
Beautifully explained, thank you.
thaks bro, a wasnt understanding to much the volume of docker and a finally undestood this part of docker. And also i finally can code with docker
In docker compose you can add a dependency to mysql, so it will first start mysql before starting the nestjs server.
I love this tutorial.
If anyone is facing the trouble " Error: Cannot find module '/usr/src/app/dist/main " . You can change the start:prod script in package.json to: "start:prod": "node dist/src/main",
it is because the main file inside the container is inside the /usr/src/app/dist/src/main> I don't know the reason behind this. It must be something related to the tsconfig file. If you go check the files under the container the main file is in /usr/src/app/dist/src/main so, that works. Basically you need to provide the path of the main.js file of your container in your package.json file.
If you try to build the application without docker ( in terminal ) after changing the path it won't work again because in dev environment the main file is inside the dist/ folder so hope you got the drill.
Thank you! You saved me a good amount of debug time.
thank you bro, very nice tutorial!!!
You're welcome!
can you create a video about e2e and unit testing in jest in nestjs covering all the aspects of testing. Thanks
I have. Check my NestJS playlist. th-cam.com/play/PL_cUvD4qzbkw-phjGK2qq0nQiG6gw1cKK.html
Hi Anson, could you show us what vscode extensions you are using for your projects ?
Is NestJS popular? Does heavy load services use NestJS ?
greate totorial ! thanks
thank
Whats the difference in RUN and CMD command? if command like this `RUN npm run build` is possible then why added `CMD [ "npm", "run", "start:prod" ]` why not `RUN npm run start:prod`?
I got an "TypeError [ERR_STREAM_NULL_VALUES]: May not write null values to stream" at "npm i" instruction. How can I fix it?
Hi I have one question how can i check the databasemeans table and all?
hello sir thanks for the video again
may i request a real world example using nestjs as backend and angular as front end.
thanks you before
Bro please make a video express js with typescript
hello anson . thanks for this video . im following your video but im having a problem on the hot reload on the tsconfig.json its not working . im using the latest typescript version on the dev dependencies
I would double check the volumes and make sure they are mounted correctly. If you're on Windows make sure the watchOptions in the tsconfig is configured correctly... Here's a Stack Overflow link that may help - stackoverflow.com/questions/74815121/why-is-hot-reloading-not-working-in-my-nestjs-docker-compose-multistage-project
@@ansonthedev thanks for this anson ! started watching all of your nest js videos because im starting to a new company and nest js is one of their stack ! . really love the way you teach to code its like watching traversy media . again thank you !
I am getting
Error: Cannot find module '/src/nest/dist/main'
my dockerfile
FROM node:alpine
WORKDIR /src/nest
COPY package*.json .
RUN npm install -g @nestjs/cli
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm","run","start:dev" ]
docker-compose.yaml
version: '2.24.3'
services:
server:
container_name: server
build:
context: ./nest
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./nest/src:/src/nest/src
can anyone help me on this ?
i got the same problem. Did you find the solution?
@@Максим-в3ф6о no !! What's the solution??
FROM node:alpine
WORKDIR /src/nest
COPY package*.json .
RUN npm install -g @nestjs/cli
RUN npm install
RUN npm run build // ==> missing
COPY . .
EXPOSE 3000
CMD [ "npm","run","start:dev" ]
just add src to your start:prod script in package.json, like this: "start:prod": "node dist/src/main"