title: configuration management in Docker Containers
body: <p>Currently I have configurations files stored in GitHub. I have a single json file with format as below
  <code>{</code>
      <code>DEV:</code>
            <code>{ key1 : val1, key2 : val2 }</code>,
      <code>PROD:</code>
            <code>{ key1 : val1, key2 : val2 }</code>
  <code>}</code>.</p>
  
  <p>My build system clones the git repo, builds the projects and creates a Docker image and stores in private Docker registry. I have the jar files and configuration files copied into Docker image. Whenever I spin up a container I inject an environment variable (ENV=DEV/PROD) which my code uses to read configs based on environment. </p>
  
  <p>I have couple of questions here:</p>
  
  <ul>
  <li><p>What is the best way to maintain environment specific configuration?</p></li>
  <li><p>Configuration files may contain sensitive data such as api keys and secrets how can I encrypt and store and decrypt when I build Docker image?</p></li>
  <li>If I want to change some configuration I need to trigger build because my configuration file is placed inside Docker image. Can I place config files outside Docker container as a volume so that I can replace config file and restart container so that code reads updated configs? If I want to place outside of Docker container can I still use any cluster management tools for container orchestration/management (Kubernetes/ECS)?</li>
  <li>What is the way to make apps running in Docker containers read updated configs by just restarting the container instead of building a new docker image and deploying a new container?</li>
  </ul>