3 ms·
The code does change inside the docker container when it's mounted as a volume, you just have to watch for it. We (at http://www.duecourse.com http://www.duecou
by jackweirdy 10y ago
The code does change inside the docker container when it's mounted as a volume, you just have to watch for it. We (at http://www.duecourse.com http://www.duecourse.com, a mostly node + Microservices shop) use nodemon for this
- was_boring 10y agoHow do you deal with node_ modules and its insistence of being in the same folder as the source for your app? This has been one of the great challenges for me. Nothing seems to work well with volume mapping.
- jackweirdy 10y agoYeah, 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.