Docker Community Forums

Share and learn in the Docker community.

Files in Docker volumes not refeshing on Windows on file change


(Mariaczi) #1

I had Docker for Windows, switched to Docker toolbox and now back to Docker for Windows and I ran into the issues with Volumes.

Before volumes were working perfectly fine and my containers which running with nodemon/tsnode/CLI watching files were restarting properly on source code change, but now they don’t at all, so it looks like file changes from host are not populated in the container.

This is docker-compose for one service:

api:
   build:
     context: ./api
     dockerfile: Dockerfile-dev
   volumes:
     - ./api:/srv
   working_dir: /srv
   links:
     - mongo
   depends_on:
     - mongo
   ports:
    - 3030:3030
   environment:
     MONGODB: mongodb://mongo:27017/api_test
   labels:
     - traefik.enable=true
     - traefik.frontend.rule=Host:api.mydomain.localhost

This id Dockerfile-dev

FROM node:10-alpine
ENV NODE_ENV development
WORKDIR /srv
EXPOSE 3030
CMD yarn dev // simply nodemon, working when ran from host

Can anyone help with that?
C drive is shared and verified with docker run --rm -v c:/Users:/data alpine ls /data showing list of files properly.

I will really appreciate any help.