john_ryan
john_ryan

Reputation: 1787

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!

Upvotes: 12

Views: 3997

Answers (1)

Kevan Ahlquist
Kevan Ahlquist

Reputation: 5533

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.

Upvotes: 8

Related Questions