Using Docker for Local Development in NodeJS projects

preview_player
Показать описание
This video shows how to use Docker for local development.

- How to set up a development docker file
- How to use docker-compose for local development
- Demonstrates hot reloading in the local environment for docker.

Github Repo:

Article:
Рекомендации по теме
Комментарии
Автор

Brilliant man. You help me so much. This make my dev environment much easier. Thank you.

bmejia
Автор

Hi man. Thanks for the video. One issue I have is that if I don't have node module installed locally, it wont work. That's because of the volume overwriting the modules being installed by docker.

If I remove the volumes instruction from the docker-compose file, command is working, but not hot reload.
Any way to fix this, as having node mules installed locally isn't exactly the point of docker ?
Hope I'm clear, pretty new to docker :)

norbzzz
Автор

package.json missing when ran with latest version of docker, what is needed to fix this?

MohammadAApu
Автор

How can I use vs code JS debugger here ?

anuragprakash
Автор

This is really helpful! Btw, should we include "node_modules" in .dockerignore file?

thefellowbreather
Автор

If someone is getting the issue where nodemon does not reload after making changes, then change the script to start nodemon. Add '-L' to the nodemon script.

E.g
'nodemon -L index.js'

ritishtimalsina