title: Node and docker - how to handle babel or typescript build?
body: <p>I have a node application that I want to host in a Docker container, which should be straight forward, as seen in this article:</p>
  
  <p><a href="https://nodejs.org/en/docs/guides/nodejs-docker-webapp/" rel="noreferrer">https://nodejs.org/en/docs/guides/nodejs-docker-webapp/</a></p>
  
  <p>In my project, however, the sources can not be run directly, they must be compiled from ES6 and/or Typescript.  I use gulp to build with babel, browserify and tsify - with different setups for browser and server.</p>
  
  <p>What would be the best workflow for building <strong>and automating</strong> docker images in this case?  Are there any resources on the web that describes such a workflow?  Should the Dockerimage do the building after <code>npm install</code> or should I create a shell script to do all this and simply have the Dockerfile pack it all together?</p>
  
  <p>If the Dockerfile should do the build - the image would need to contain all the dev-dependencies, which are not ideal?</p>
  
  <p>Note: I have been able to set up a docker container, and run it - but this required all files to be installed and built beforehand.</p>