Search code examples
node.jsdockergulplivereloadgulp-watch

Docker development workflow with node.js


I'm trying to use docker with a node.js web app i'm working on.

I have familiarized myself with the docker concepts and gotten up and running with the example here: https://docs.docker.com/examples/nodejs_web_app/

I get the general process...write a Dockerfile -> Build a docker image -> run it in a VM.

However, it seems impractical to rebuild the image and restart the container every time I change a file.

I currently have a gulp / live-reload setup that works great for development so I was wondering if there was any recommended way of accomplishing something like this with docker.

Thanks!


Solution

  • You can mount the source directory in the container as a volume and use the same gulp/livereload setup that you currently use now. Here's an example project with this setup. If you run into port issues with livereload see here.