For generating configs for my Docker services using gomplate
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
IamTheFij 03406f4105 Initial commit 2 months ago
tests Initial commit 2 months ago
.drone.yml Initial commit 2 months ago
.pre-commit-config.yaml Initial commit 2 months ago
Dockerfile Initial commit 2 months ago
LICENSE.txt Initial commit 2 months ago
Makefile Initial commit 2 months ago
Readme.md Initial commit 2 months ago
manifest.tmpl Initial commit 2 months ago
run.sh Initial commit 2 months ago

Readme.md

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

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.

  config:
    image: hairyhenderson/gomplate
    command: [
      "--datasource", "secrets=/data/secrets.yml",
      "--input-dir", "/templates",
      "--output-dir", "/config"
    ]