title: Using Docker for development, should I use ADD or VOLUME?
body: <p>I'm starting to use Docker on projects, and the majority of these projects runs on PHP (some on Nginx/PHP-FPM, some on Apache/PHP as module).</p>
  
  <p>The thing is: my brain can't understand when to use the ADD and VOLUME directives on the Dockerfile for the paths that holds the source code. </p>
  
  <p>Here's what I want: to change a line of code, access the browser on the container port, and see the changes. And so on, until things run as expected and then I "add" the code to the machine and deploy it. It's how I think Docker runs. Am I wrong?</p>
  
  <p>AFAIK, the ADD directive copies the files on the given path to the image, and the VOLUME directive just say that a given path will me mounted by|on the Host. </p>
  
  <p>Things that run through my mind, so far:</p>
  
  <ol>
  <li><p>Add the source code files via ADD, and then user the "-v" switch on command line to mount the source code on the same path used on ADD. </p></li>
  <li><p>Use VOLUME, and deal with two different Dockerfiles: for development containers, and for testing/development, and build each one as needed (this thing I think is counterproductive, and my heart tells me that this is not how it should work).</p></li>
  </ol>
  
  <p>Can someone help me with this? What my brain can't grasp, and I should do (and understand) to leverage my Docker knowledge?</p>