Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21eafc610b | ||
|
|
3199b5e542 |
No files matched your search
@@ -4,5 +4,5 @@ Copier template for a `caddy/` directory: a portable `site.caddy` for the projec
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
copier copy --trust -d project_slug=my_thing -d 'routes=["api","frontend"]' <this-repo> <dest>
|
copier copy --trust -d project_slug=my_thing -d 'routes=["api","frontend"]' <this-repo> <dest>
|
||||||
copier update -a .copier-answers.caddy.yml
|
copier update -a .copier/caddy.yml
|
||||||
```
|
```
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
_subdirectory: template
|
_subdirectory: template
|
||||||
_templates_suffix: .jinja
|
_templates_suffix: .jinja
|
||||||
_answers_file: .copier-answers.caddy.yml
|
_answers_file: .copier/caddy.yml
|
||||||
_envops:
|
_envops:
|
||||||
keep_trailing_newline: true
|
keep_trailing_newline: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
{{ project_slug | upper }}_DOMAIN={{ project_slug | replace('_', '-') }}.localhost
|
{{ project_slug | upper | replace('-', '_') }}_DOMAIN={{ project_slug | replace('_', '-') }}.localhost
|
||||||
CLOUDFLARE_API_TOKEN=
|
CLOUDFLARE_API_TOKEN=
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
.env
|
.env
|
||||||
Caddyfile
|
/Caddyfile
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{%- set dash = project_slug | replace('_', '-') -%}
|
{%- set dash = project_slug | replace('_', '-') -%}
|
||||||
# caddy
|
# caddy
|
||||||
|
|
||||||
`site.caddy` routes `{{ '{$' }}{{ project_slug | upper }}_DOMAIN}` to the project's services over the external `caddy` docker network. It works standalone and inside a shared Caddy that fronts several projects.
|
`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:
|
Standalone:
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ cp .env.example .env
|
|||||||
docker compose up -d
|
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 }}_DOMAIN` in its environment.
|
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:
|
Rules that keep `site.caddy` portable:
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{%- set dash = project_slug | replace('_', '-') -%}
|
{%- set dash = project_slug | replace('_', '-') -%}
|
||||||
{%- set domain = project_slug | upper ~ '_DOMAIN' -%}
|
{%- set domain = project_slug | upper | replace('-', '_') ~ '_DOMAIN' -%}
|
||||||
{$ {{- domain -}} } {
|
{$ {{- domain -}} } {
|
||||||
encode zstd gzip
|
encode zstd gzip
|
||||||
{% if 'api' in routes and 'frontend' in routes %}
|
{% if 'api' in routes and 'frontend' in routes %}
|
||||||
|
|||||||
Reference in new issue
Block a user