title: Adding git repository to docker image (workflow best practices)
body: <p>I'm deploying an nginx instance. The dockerfile as well as the nginx configuration data and web app live in my git repository. It seems to make sense to me that this is all one git repository: the application and how to deploy it. In Dockerfile I want to say (this is simplified a bit, but the point is that I can't)</p>
  
  <pre><code>COPY web-app /serving
  COPY docker/site-conf /etc/nginx/sites-enabled/
  </code></pre>
  
  <p>where I have this directory structure:</p>
  
  <pre><code>my-git-root
      web-app
         ...
      docker
          Dockerfile
          build.sh
          site-conf
  </code></pre>
  
  <p>The problem, at least in part, is that docker's context is my-git-root/docker/ .</p>
  
  <p>In the spirit of immutable services, I would like the container to have a snapshot of the git repository rather than apt-get install'ing git in the container and pulling the data. But I don't see how to make this work unless I separate out docker stuff to a separate git repository, then git clone the web app on each build -- I'd rather not let anyone even be tempted to git pull in a live container.</p>
  
  <p>Suggestions on a more sane workflow?</p>