title: Docker in production, source data, db data, update process
body: <p>I just start using docker, and at this moment I have some questions about docker in the production environment.</p>
  
  <ol>
  <li><p>First of all, what permissions should I use on prod server? Should I create non root user and run docker under this user? Or it does not matter.</p></li>
  <li><p>What about firewall, should I open ports for docker? </p></li>
  <li><p>The big problem for me - where I should store the source code of my application? In compose docs is written, that I should move all my sources into the image, avoid using volume bindings at all <a href="https://docs.docker.com/compose/production/" rel="nofollow noreferrer">https://docs.docker.com/compose/production/</a>. But how the update process using git will look like in this case? Does it mean that each time i would update all image? </p></li>
  <li><p>How to move all sources into the image using compose?</p></li>
  <li><p>Where to store DB data, in container or i should bind it using volume?</p></li>
  <li><p>What about permissions in a container? Should i create a non root user inside the container? Before docker it was preferred way, best practice, but with docker I don’t see any reasons for this. </p></li>
  </ol>