3 ms·
Yeah, that's a PITA. We currently just don't mount node_modules at all, and run npm install when we build the image, and have to re-build whenever we change pa
by jackweirdy 10y ago
Yeah, that's a PITA.
We currently just don't mount node_modules at all, and run npm install when we build the image, and have to re-build whenever we change package.json. It sounds bad, but once we've got something working we tend not to need to add new dependencies, it's normally just code changes from there on out.
As an example, here's a docker compose for one service:
ports:
- "20003:20003"
volumes:
- ./APP/src:/opt/app/src
- ./APP/test:/opt/app/test
command: npm run dev
`run dev` is the thing that calls nodemon, which reloads whenever src or test change. Otherwise, everything like node_modules exists inside the image.