5 ms·
Take a look at confd, a single statically-linked executable that can expand config file templates using environment variables: https://github.com/kelseyhightow
by grosskur 12y ago
Take a look at confd, a single statically-linked executable that can expand config file templates using environment variables:
https://github.com/kelseyhightower/confd https://github.com/kelseyhightower/confd
Basically, you add confd into your Docker image and execute it at runtime to do just-in-time config file generation. Here's an example for nginx:
https://github.com/grosskur/nginx-confd-dockerfile https://github.com/grosskur/nginx-confd-dockerfile
You can create separate environment variable files for beta/staging/prod and pass --env-file to "docker run".
This lets you use the same Docker image across all your environments and avoid the operational complexity of mounting config files in Docker volumes.