title: Access node modules in typescript while using docker & docker compose
body: <p>I'm trying to create a docker image that is hosting a NodeJS project during develop. It simply executes the NodeJS application with nodemon so it restarts every time when I make changes.</p>
  
  <p>I also use TypeScript to develop the application. TypeScript must have access to a installed <code>@types</code> module. However the mounted volume that should show the <code>node_modules</code> folder is empty. So TypeScript cannot find the modules and cannot compile. My IDE is also complaining (obviously)</p>
  
  <p>Is there a way to make the <code>node_modules</code> visible for TypeScript?</p>
  
  <p>This is my Dockerfile:</p>
  
  <pre><code>FROM node:alpine
  
  # Create app directory
  WORKDIR /usr/src/app
  
  # Install app dependencies
  COPY package.json .
  
  RUN npm install
  
  # Bundle app source
  COPY . .
  
  # Run app
  CMD [ "npm", "start" ]
  </code></pre>
  
  <p>This is my docker-compose.yml:</p>
  
  <pre><code>version: "3"
  
  services:
    server:
      build: .
      environment:
        - NODE_ENV=development
      command: npm run debug
      volumes:
        - .:/usr/src/app
        - /usr/src/app/node_modules
      ports:
        - "8080:8080"
        - "9229:9229"
  </code></pre>