title: Missing `node_modules` in Docker Container
body: <p>I'm building a docker docker image for my Node.js application using the following <code>Dockerfile</code>:</p>
  
  <pre><code>FROM keymetrics/pm2:latest
  
  RUN apk add --no-cache --update alpine-sdk python
  
  # Bundle APP files
  COPY package.json .
  
  # Install app dependencies
  ENV NPM_CONFIG_LOGLEVEL warn
  RUN npm install
  RUN npm rebuild bcrypt --build-from-source
  
  COPY . .
  
  # Show current folder structure in logs
  RUN ls -al
  
  EXPOSE 3000
  VOLUME /app/uploads
  
  CMD [ "pm2-docker", "start", "pm2.json" ]
  </code></pre>
  
  <p>The issue is that the <code>node_modules</code> folder is not present in docker containers created from this image hence the application encounters an error won't run.</p>
  
  <p>I have <code>node_modules</code> in my <code>.dockerignore</code> file but since I'm installing the necessary packages in the build process (<code>RUN npm install</code>), this shouldn't cause an issue. </p>