docker-gonfigurator/Readme.md

47 lines
1.2 KiB
Markdown

# Gonfigurator
Runs `gomplate` to generate config files from a template folder in a way that allows them to be edited.
On start, this container will look at all files in your `/templates` directory and template them and write them to the `/config` directory. Because some containers may need to modify these files and you may not want those changes blown away, this container will check it see if the template file is newer than the file residing in the `/config` path. If it is not, then the file will be skipped.
## Usage
```yaml
version: '3.8'
services:
main:
image: ...
volumes:
- config:/config
config:
image: iamthefij/gonfigurator
volumes:
- config:/config
- ./templates
volumes:
config:
```
You may override the `/templates` dir and the output `/config` with `$INPUT_DIR` and `$OUTPUT_DIR`, respectively.
## Alternatives
### Docker Config / Secrets
Files are read only and cannot be edited by application
### Using gomplate only
All files will be overrwriten whenver the container starts
Eg.
```yaml
config:
image: hairyhenderson/gomplate
command: [
"--datasource", "secrets=/data/secrets.yml",
"--input-dir", "/templates",
"--output-dir", "/config"
]
```