title: Docker & Docker Compose - COPY for prod image but mount volume for dev
body: <p>I'm building a small NodeJS/Express app that I'm Dockersing and deploying to Compute Engine. I have my <code>docker-compose.yml</code> set up for development (i.e. I'm mounting my source directory so I can make changes without rebuilding).</p>
  
  <p>When I'm ready for production I'll be building my image and pushing it to a container registry on Google Cloud. When I do so, I'd like to bake my source code into the image. Note: this is a one-man project and I'm not setting up any kind of CI. I can do this with <code>COPY</code> in my <code>Dockerfile</code> but I use the same <code>Dockerfile</code> for development. Is it OK to use a different <code>Dockerfile</code> for production and development or is there a method for me to do this conditionally within the <code>Dockerfile</code> itself? Something like...</p>
  
  <pre><code>if ENV=production
    COPY blah ./
    ...
  </code></pre>