Files
ansible/roles/docker/templates/caddy-compose.yml.j2
T
PhilandClaude Opus 5.5 9696c0e441 caddy: reload instead of restart, validate before deploy, HTTP catch-all, header timeout, body limits; dns: drop stale records
- Caddyfile moves to config/ (directory mount) so 'caddy reload' sees the
  new file; the handler reloads gracefully instead of restarting
- template validate: runs 'caddy validate' with the image Caddy uses
- http:// catch-all aborts plain-HTTP requests for unknown hosts / bare IP;
  known hosts keep the automatic HTTPS redirect (tested)
- read_header timeout 10s (default 1 min)
- body_limit snippet: 1MB static sites, tinyauth, repaircafe; 10MB Pocket ID,
  Changedetection, ByteStash, Gotify, iGotify; 20MB Baikal
- dns: remove grist, habits, office, podcasts, pdftools (nothing serves them)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 13:13:16 -07:00

29 lines
573 B
Django/Jinja

services:
caddy:
image: {{ caddy_image }}
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
{% if caddy_custom %}
env_file: .env # CROWDSEC_API_KEY
{% endif %}
volumes:
- ./config:/etc/caddy:ro
- ./site:/srv
- caddy_data:/data
- caddy_config:/config
labels:
mag37.dockcheck.update: true
networks:
default:
ipv4_address: {{ docker.hairpin_ip }}
volumes:
caddy_data:
caddy_config:
networks:
default:
external: true
name: {{ docker.network_name }}