diff --git a/.copier/caddy.yml b/.copier/caddy.yml index 1613101..51ca6a9 100644 --- a/.copier/caddy.yml +++ b/.copier/caddy.yml @@ -1,4 +1,4 @@ -_commit: v0.1.2 +_commit: v0.1.4 _src_path: https://git.kotikot.com/templates/caddy.git project_slug: lodge routes: diff --git a/caddy/.gitignore b/caddy/.gitignore index acd0b35..a9e5752 100644 --- a/caddy/.gitignore +++ b/caddy/.gitignore @@ -1,2 +1,2 @@ .env -Caddyfile +/Caddyfile diff --git a/caddy/README.md b/caddy/README.md index ebd199d..23fce9c 100644 --- a/caddy/README.md +++ b/caddy/README.md @@ -1,22 +1,3 @@ # caddy -`site.caddy` routes `{$LODGE_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: - -```sh -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/lodge:ro`, keep `import /etc/caddy/projects.d/*/site.caddy` in its Caddyfile and put `LODGE_DOMAIN` in its environment. - -Rules that keep `site.caddy` portable: - -- the domain comes only from the environment variable -- no `tls` block, 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 off` makes `caddy reload` impossible +`site.caddy` routes `{$LODGE_DOMAIN}` to the project over the external `caddy` network. In a shared Caddy, mount this directory as `/etc/caddy/projects.d/lodge:ro` and set `LODGE_DOMAIN`. Keep it portable: domain only from the env, no `tls`, snippets prefixed with `lodge_`.