https://www.freecodecamp.org/news/how-to-enable-live-reload-on-docker-based-applications/
==================================================================
- Node.js v10+
- MongoDB running on local instance
- PORT: 3000
- MONGO_URL: localhost:27017
- Install dependencies -
npm i
- Build typescript -
npm run build
- Run project -
npm start
- Go to swagger page -
localhost:3000/
- Run once -
npm run dev
- Run and watch files -
npm run dev:watch
Consequently, when creating the node_modules folder on the container, it won't create the folder on local machine environment. Run the command below in your terminal to create it:
- docker volume create --name nodemodules
docker-compose up --build docker-compose down