docs: short readme
This commit is contained in:
1 parent
21eafc610b
commit
bbae6b5798
2 files changed
+3
-21
No files matched your search
@@ -1,23 +1,5 @@
|
||||
{%- set dash = project_slug | replace('_', '-') -%}
|
||||
{%- set domain = project_slug | upper | replace('-', '_') ~ '_DOMAIN' -%}
|
||||
# caddy
|
||||
|
||||
`site.caddy` routes `{{ '{$' }}{{ project_slug | upper | replace('-', '_') }}_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/{{ dash }}:ro`, keep `import /etc/caddy/projects.d/*/site.caddy` in its Caddyfile and put `{{ project_slug | upper | replace('-', '_') }}_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 `{{ '{$' }}{{ domain }}}` to the project over the external `caddy` network. In a shared Caddy, mount this directory as `/etc/caddy/projects.d/{{ dash }}:ro` and set `{{ domain }}`. Keep it portable: domain only from the env, no `tls`, snippets prefixed with `{{ project_slug }}_`.
|
||||
Reference in new issue
Block a user