Docker node development environment on windows

I’m developing a simple NodeJS application. I use docker and it makes it very easy to deploy to production.
This is my Dockerfile:

FROM node
COPY . /src
RUN cd /src; npm install
EXPOSE  3000
CMD ["node", "/src/express.js"]

On my development environment (windows, boot2Docker) Docker is slowing me down, because for every small change I do, I have to re-build the Docker image and run the container and it takes a few minutes.
I couldn’t find a way to simply copy my source files from the host to the docker container. Is there an easy way to do it? Should I use plain nodeJS on my development environment and only use Docker in production?

  • Docker 1.12 on Mac issue with DB connection pool
  • Privileged containers and capabilities
  • Ignite on Docker
  • How to force pull docker images in DC OS?
  • How to ignore certificate errors in Boot2Docker on windows
  • /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
  • Thanks!

  • How can I make docker machine to get images from host before pulling any image for itself?
  • How to capture packets for single docker container
  • Docker PHP5.6 Call to undefined function bindtextdomain()
  • Linking my custom docker container to another custom container
  • How to install app from git repository via docker?
  • Connectionstring from docker container to SQL Server dblocal in host
  • 2 Solutions collect form web for “Docker node development environment on windows”

    At least during development, you could share a folder from your windows OS with docker – would make the code-debug cycle a lot quicker.

    Mount a Host Directory as a Data Volume:
    https://docs.docker.com/userguide/dockervolumes/

    (about 1/2 way down the page)

    Try the following:

    FROM node
    COPY ./package.json /src
    RUN cd /src && npm install
    COPY . src/
    EXPOSE  3000
    CMD ["node", "/src/express.js"]
    

    The way you originally have it will install npm packages everytime you change something within src. If we separate this step, these packages will only be installed if the package.json file changes.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.