999 B
999 B
caddy
site.caddy routes {$BEAVERGRAM_DOMAIN} to the project's services over the external caddy docker network. It works standalone and inside a shared Caddy that fronts several projects.
Standalone:
docker network create caddy
cp Caddyfile.example Caddyfile
cp .env.example .env
docker compose up -d
Shared Caddy: mount this directory as /etc/caddy/projects.d/beavergram:ro, keep import /etc/caddy/projects.d/*/site.caddy in its Caddyfile and put BEAVERGRAM_DOMAIN in its environment.
Rules that keep site.caddy portable:
- the domain comes only from the environment variable
- no
tlsblock, certificates are configured by the host Caddy (acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN}in the global block) - snippets are prefixed with the project slug because Caddy snippets are global
- mount the directory, not the file: a single-file bind mount goes stale when git replaces the inode
- keep
admin localhost:2019,admin offmakescaddy reloadimpossible