title: Self-contained Docker image with Laravel app (no shared volume)
body: <p>There are at least a dozen tutorials on the web about how to set up a Laravel app with Docker. The basic set up they all use is 3 Docker containers:</p>
  <ul>
  <li>nginx container</li>
  <li>php-fpm container</li>
  <li>mysql container</li>
  </ul>
  <p>The Nginx and PHP-fpm containers rely on a shared volume. HTTP request comes into Nginx for a file on the shared volume. Nginx hands the request off to PHP-fpm. Php-fpm also has access to the files in the shared volume so it can run the scripts.</p>
  <p>For development, this is fantastic. I can edit the files in the shared volume and immediately test the changes. But I'm questioning whether I want this for production. Do I actually want any of my code to be on the server running Docker? This seems to defeat some of the purposes of Dockerising it in the first place. It seems like I would want the code to be self-contained inside a Docker container running both nginx AND PHP-fpm (database can be a separate container or service in the hosted environment).</p>
  <p>Is my thinking correct here? What is considered to be the best practice for deploying Laravel in Docker for production?</p>