Skip to main content

My ultimate Docker Compose template toolkit: Boilerplates v2

In this video, I demonstrate my brand-new open-source CLI tool boilerplates, that generates customizable Docker Compose templates with interactive and non-interactive workflows. We cover listing and searching the template library, setting user defaults, handling secrets, and generating Traefik, Authentik, and Portainer stacks.

Instructions
#

Install Boilerplates v2
#

# Install via script
curl -fsSL https://raw.githubusercontent.com/christianlempa/boilerplates/main/scripts/install.sh | bash

# Verify installation
boilerplates --version

Manage the template library
#

boilerplates repo --help
boilerplates repo update

# Discover templates
boilerplates list
boilerplates search <template_id>

# Explore modules (Compose is the first module)
boilerplates compose --help

Inspect a template
#

boilerplates show portainer

Generate a Docker Compose stack (Portainer example)
#

# Generate interactively
boilerplates generate portainer

# Generate non-interactively with custom variables
boilerplates generate portainer --no-interactive \
  --var traefik_enabled=true \
  --var traefik_network=proxy \
  --var container_timezone=Europe/Berlin

Set user default variables
#

If you repeat the same options (e.g., Traefik network, timezone), set user defaults once:

python3 -m cli compose defaults --help

python3 -m cli compose defaults set traefik_enabled=true
python3 -m cli compose defaults set traefik_network=proxy
python3 -m cli compose defaults set container_timezone=Europe/Berlin

Defaults are applied to future generations and can be overridden per run with –var.

References
#

Christian Lempa
Author
Christian Lempa
IT & Tech Nerd | DevOps and Automation FanBoy