title: Create docker container that only contains webapp and server
body: <p>I have a project that basically has a structure like this: <strong>(*)</strong></p>
  
  <pre><code>my_project/
      ├── server/
      │   ├── node_modules/
      │   └── server.js
      ├── src/
      ├── node_modules/
      ├── Dockerfile
      └── {multiple important config files for webpack and typescript etc}.json 
  </code></pre>
  
  <p>I build the project with <code>npm run build</code>. This creates a <code>dist/</code> folder from the <code>src/</code> folder.</p>
  
  <p>This is my <code>package.json</code>: </p>
  
  <pre><code>"scripts": {
      "prebuild": "npm run install:client &amp;&amp; npm run install:server",
      "build": "webpack",
      "install:client": "npm install",
      "install:server": "cd server/ &amp;&amp; npm install"
  }
  </code></pre>
  
  <p>The final project only needs this: <strong>(**)</strong></p>
  
  <pre><code>my_project/
      ├── server/
      │   ├── node_modules/
      │   └── server.js
      └── dist/
           ├── webapp/
           └── assets/
  </code></pre>
  
  <p>Now I want to create a docker image out of this.</p>
  
  <p>I have a <code>Dockerfile</code> that's working now. It looks like this:</p>
  
  <pre><code>FROM node:boron
  WORKDIR /usr/src/app
  COPY package.json .
  COPY . .
  RUN npm run build
  EXPOSE 9090
  CMD [ "node", "server/server.js" ]
  </code></pre>
  
  <p>But from my understanding, it copies everything I have in my directory and and then creates <code>dist/</code> folder and final docker image contains all of this: <strong>(***)</strong></p>
  
  <pre><code>my_project/
      ├── server/
      │   ├── node_modules/
      │   └── server.js
      ├── src/
      ├── node_modules/
      ├── Dockerfile
      ├── {multiple important config files for webpack and typescript etc}.json 
      └── dist/
           ├── webapp/
           └── assets/
  </code></pre>
  
  <p>How can I configure the Docker image to contain only the things in <strong>(**)</strong></p>