title: How to compile typescript in Dockerfile
body: <p>I'm having trouble compiling my nodejs typescript application from a Dockerfile. When I build my docker image an inspect it is missing the dist folder entirely.</p>
  
  <p>Dockerfile:</p>
  
  <pre><code># Template: Node.js dockerfile
  # Description: Include this file in the root of the application to build a docker image.
  
  # Enter which node build should be used. E.g.: node:argon 
  FROM node:latest
  
  # Create app directory for the docker image
  RUN mkdir -p /usr/src/app
  WORKDIR /usr/src/app/dist
  
  # Install app dependencies from package.json. If modules are not included in the package.json file enter a RUN command. E.g. RUN npm install &lt;module-name&gt;
  COPY package.json /usr/src/app/
  RUN     npm install
  RUN     npm install tsc -g
  RUN     tsc
  
  # Bundle app source
  COPY . /usr/src/app
  
  # Enter the command which should be used when the image starts up. E.g. CMD ["node", "app.js"]
  CMD [ "node", "server.js"]
  </code></pre>
  
  <p>When I run the image locally and ls to reveal files/folders:</p>
  
  <pre><code># ls
  node_modules  package-lock.json  package.json  src
  </code></pre>
  
  <p>Any suggestions to where i am going wrong?</p>