Running an immutable setup in production I'm looking into using Docker to streamline my Drupal development workflow. One approach would be to locally create a Docker image for my Drupal installation (not the database, just the Drupal files default found under /var/www/html), and deploy that image to production. 

This approach would imply that all changes to the Drupal installation, i.e. all changes to anything under /var/www/html, would be considered immutable or read-only in production. Any changes here would be gone when the next deployment comes along. 

I assume the content created by our content creators logged into our production server, is stored in the database, not in the Drupal installation itself. 

My question is: Is there any reason why the Docker installation (i.e. files under /var/www/html) would need to be changed when deploying to production, or can these files remain consistent across environments (dev, test, prod)? 

Note that I'm quite new to Drupal.
The file containing the credentials for accessing the database, and other site configurations (e.g. the proxy settings, the trusted domains), is inside the server document root (for example, sites/default/settings.php). The answer to Is there any reason for which the content of the server document root would need to be changed when deploying to production? is then yes.

Add to this the fact that the directory for the public files (e.g. the uploaded images attached to nodes) is by default sites/default/files, you have a reason more to preserve one or more directories under the server document root directory in the production environment.