title: Recommended way to provide configuration files to Docker containers
body: <p>I am moving our web application to docker-compose deployment (Django, DRF, AngularJS).</p>
  
  <p>Docker looks solid now and things are going well.</p>
  
  <p>I want to:</p>
  
  <ul>
  <li>confirm with you that I am following best practices regarding application configuration files</li>
  <li>know if "volume files" are actually bind mounts, which are not recommended</li>
  </ul>
  
  <p>I've managed to use environment variables and docker-compose secrets read from the Django <code>settings.py</code> file and it works. The downside is that environment variables are limited to simple strings and can pose some escape challenges when sending Python lists, dictionaries etc. We also have to define and maintain a lot of environment variables since our web app is installed in many place and it's highly configurable.</p>
  
  <p>On frontend side (AngularJS) we have two <code>constants.js</code> files and the nginx conf.
  I've used a <code>CMD ["/start.sh"]</code> in Dockerfile and have some <code>sed</code> commands.
  But this looks really hackish and it also means that we have to define and maintain quite a few environment variables.</p>
  
  <ol>
  <li><p><strong>Are Docker volumes a good idea to use for these configuration files?</strong></p></li>
  <li><p><strong>Does such thing as "volume file" actually exist</strong> (<a href="https://stackoverflow.com/questions/42248198/how-to-mount-a-single-file-in-a-volume">mentioned here</a>) or is it actually a bind mount? And bind mounts are less recommendable since they depend on the file system and file path on the host.</p></li>
  </ol>
  
  <p><a href="https://docs.docker.com/storage/volumes/#choose-the--v-or---mount-flag" rel="noreferrer">Volumes documentation</a> briefly mentions files: "path where the file or directory are mounted in the container", but does not go into greater detail.</p>
  
  <p>Our web app has simple configuration files now:</p>
  
  <ul>
  <li><code>settings.py</code></li>
  <li><code>site\contants.js</code></li>
  <li><code>admin\constants.js</code></li>
  </ul>
  
  <p>and:</p>
  
  <ol start="3">
  <li><p>I want to avoid moving those files to dedicated directories that can be mounted.</p></li>
  <li><p><strong>Can you show me a sample docker-compose.yml with single file volumes (not bind mounts)</strong>.</p></li>
  </ol>
  
  <p>Thank you</p>