docs: templating

See toolshed/organising#521
This commit is contained in:
2025-08-30 12:49:53 +02:00
parent 09b90a7b8e
commit 48489718b6

View File

@ -256,6 +256,20 @@ file_env "DB_PASSWORD"
Sometimes the containers don't even have Bash installed on them. You had better just use `/bin/sh` or, in your entrypoint script, install Bash :upside_down: The entrypoint secrets hack listed above doesn't work in this case (as it requires Bash), so instead you can just do `export FOO=$(cat /run/secrets/<secret-name>)`.
## Templating
### Templating domain names in the `.env.sample`
`<recipe>.example.com` will be transformed into the end-user app domain when `abra app new` is run.
### Templating domain names in release notes
!!! warning "Watch out for old versions of `abra` 🚧"
This feature is only available in the >= 0.11.x series of `abra`.
`<recipe>.example.com` will be transformed into the end-user app domain when `abra app upgrade` shows release notes.
## How do I reference services in configs?
When referencing an `app` service in a config file, you should prefix with the `STACK_NAME` to avoid namespace conflicts (because all these containers sit on the traefik overlay network). You might want to do something like this `{{ env "STACK_NAME" }}_app` (using the often obscure dark magic of the Golang templating language). You can find examples of this approach used in the [Peertube recipe](https://git.coopcloud.tech/coop-cloud/peertube/src/commit/d1b297c5a6a23a06bf97bb954104ddfd7f736568/nginx.conf.tmpl#L9).