title: node_modules disappear from docker-compose container after initial docker build
body: <p>I am running node.js on several docker containers and volume mounting my working directory so that I can use nodemon to rebuild my code as I make changes on my host. I have followed all of the instructions for volume mounting code from the host and separately mounting my node_modules file inside my docker container.</p>
  
  <p>The problem that I have is that the initial docker build works great however when nodemon rebuilds my code, my node_modules file is no longer there and the build fails. Restarting my container fixes the issue, but again, I cannot save my files and have nodemon rebuild the code.</p>
  
  <p>What am I doing wrong:</p>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM node:10.12.0-alpine as build
  WORKDIR /srv
  ADD ./src/package.json .
  RUN npm install
  ADD ./src .
  RUN ls
  
  FROM node:10.12.0-alpine
  WORKDIR /app
  COPY --from=build /srv .
  RUN ls
  RUN npm install pm2 -g
  RUN npm install nodemon -g
  EXPOSE 3001
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>    networks:
        - site
      build: ./api/
      volumes:
        - ./api/src:/app
        - /app/node_modules
      environment:
        STAGE: "local"
        PORT: 3001
      ports:
        - 3001:3001
      command: [ "pm2-runtime", "npm", "--", "start" ]
  </code></pre>
  
  <p>I have tried everything I can think of... </p>
  
  <ul>
  <li>removing my build container in my dockerfile</li>
  <li>removing pm2 and starting node directly.</li>
  <li>moving npm install to command in my docker file</li>
  <li>removing package.json and clearing npm cache before npm install</li>
  </ul>