Docker Community Forums

Share and learn in the Docker community.

Dev env workflow with docker-compose

(Rgehan) #1


I’ve been playing with docker for a project, and even if I’m starting to understand where it shines, I’m facing a few issues.

I’m booting two containers, a node and a mongo one. The node container mounts a source volume from the host so that code can be edited without having to rebuild the image and restart the container.

The issue there is that everytime I add a new dependency to my package.json, I have to rebuild the image and restart my containers. It is not that often, but I’m pretty sure there’s a better way to do.

I could have a sort of watcher in the container that reruns the dependency installation process, but I’m not sure it’s the best way to do. I could also use dependencies from the host (only in dev mode), but then I’d lose the advantages of bundling the dependencies in the image.

Is there a standard way to do ? What’s your opinion ?

Thanks in advance

(Sam) #2

what is your change mgmt model for this application in production (not dev)…

typically one doesn’t permit dynamic runtime changes in production
so you would periodically create an updated image and cycle it in.