This is the part I find unacceptable for a development environment. Is there a way to have live-reloading of docker instance somehow?
This is the part I find unacceptable for a development environment. Is there a way to have live-reloading of docker instance somehow?
I think restarting an entire container for such small-scale changes is a bit much. Personally, I often resort to using a development server on the active project most of the time, it's a dirty solution with the consequence being that I've negated some of the advantages of my setup - if your server software is fast at restarting, you could throw in some sort of watcher.
`rerun --background -- "foreman start"`
It is super simple and works well for us
This has been one of the great challenges for me. Nothing seems to work well with volume mapping.
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.