Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 lines
1.6 KiB
Docker
33 lines
1.6 KiB
Docker
# Caddy plus the Cloudflare DNS and rate-limit plugins. caddy-ratelimit is
|
|
# pinned to a commit (no usable release), so Renovate leaves it; bump by hand.
|
|
# Builder and runtime tags move together.
|
|
# The last RUN validates the config for both modes, so a bad config fails the
|
|
# build before any running container is replaced.
|
|
FROM caddy:2.11.9-builder AS builder
|
|
RUN xcaddy build \
|
|
--with github.com/caddy-dns/[email protected] \
|
|
--with github.com/mholt/caddy-ratelimit@5625512f24f6f59d6f64fb3aafe5eecff0b286db
|
|
|
|
FROM caddy:2.11.9
|
|
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
|
COPY Caddyfile routes.caddy /etc/caddy/
|
|
COPY sites/ /etc/caddy/sites/
|
|
# A log directory that can't be opened stops the config loading.
|
|
RUN mkdir -p /var/log/caddy /srv/www /srv/uploads
|
|
RUN set -e; \
|
|
for site in prod dev; do \
|
|
echo "caddy validate (CADDY_SITE=$site)"; \
|
|
env XDG_DATA_HOME=/tmp/validate XDG_CONFIG_HOME=/tmp/validate \
|
|
CADDY_SITE=$site DOMAIN=example.com EMAIL=[email protected] \
|
|
BACKEND_HOST=backend BACKEND_PORT=8080 BACKEND_ENDPOINT=/api \
|
|
ICECAST_HOST=icecast2 ICECAST_PORT=8000 \
|
|
GITEA_HOST=gitea GITEA_PORT=3000 \
|
|
SILVERBULLET_HOST=silverbullet SILVERBULLET_PORT=3000 \
|
|
SILVERBULLET_PUBLIC_HOST=silverbullet-public SILVERBULLET_PUBLIC_PORT=3000 \
|
|
PYTHON_HOST=python PYTHON_PORT=8000 \
|
|
RECEIPT_WEB_UPSTREAM=127.0.0.1:9 RECEIPT_WEB_TOKEN=validate \
|
|
CLOUDFLARE_DNS_API_TOKEN=validate-placeholder-token-0000000000000 \
|
|
caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile; \
|
|
done; \
|
|
rm -rf /tmp/validate /var/log/caddy/*
|