简体   繁体   中英

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!

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM