Something went wrong. Try again.
Barazo Docker Compose templates for self-hosting barazo.forum
Something went wrong. Try again.
barazo-deploy Caddyfile
2.6 kB 83 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384# Barazo Caddyfile -- Reverse Proxy with Automatic SSL## Caddy handles:# - Automatic HTTPS via Let's Encrypt (auto-renews)# - HTTP -> HTTPS redirect (automatic)# - HTTP/3 (QUIC) support# - Reverse proxy routing to API and Web services## Set COMMUNITY_DOMAIN in your .env file (e.g., "forum.example.com").
{ admin off}
# ---------------------------------------------------------------------------# Documentation site (static export served from /var/www/docs.barazo.forum/)# ---------------------------------------------------------------------------docs.barazo.forum { header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
root * /var/www/docs.barazo.forum file_server
try_files {path} {path}index.html /404.html}
{$COMMUNITY_DOMAIN} { # HSTS -- enforce HTTPS for all future requests (2 years, preload-eligible) header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
# Block /api/health/ready from external access (internal monitoring only) @healthReady path /api/health/ready handle @healthReady { respond "Forbidden" 403 { close } }
# OAuth metadata (AT Protocol requires PDS to fetch these from the client_id origin) handle /oauth-client-metadata.json { reverse_proxy barazo-api:3000 } handle /jwks.json { reverse_proxy barazo-api:3000 }
# API routes -> barazo-api:3000 handle /api/* { reverse_proxy barazo-api:3000 }
# API documentation -> barazo-api:3000 handle /docs { reverse_proxy barazo-api:3000 } handle /docs/* { reverse_proxy barazo-api:3000 }
# Everything else -> barazo-web:3001 handle { reverse_proxy barazo-web:3001 }}
# Optional: Grafana monitoring dashboard proxy.# Only active when running a separate monitoring stack (e.g., singi-labs/monitoring)# with docker-compose.monitoring-proxy.yml. Without GRAFANA_DOMAIN set, this block# defaults to "monitor.localhost" and has no effect.{$GRAFANA_DOMAIN:monitor.localhost} { header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" reverse_proxy grafana:3050}
# ---------------------------------------------------------------------------# Custom site blocks (optional)# ---------------------------------------------------------------------------# Drop additional *.caddy files into ./caddy.d/ to serve extra vhosts (e.g. a# status page, a comments backend, another app on the same box) without forking# this template. The directory is mounted read-only at /etc/caddy/conf.d and is# gitignored, so your custom config survives `git pull` and never ships here.# An empty directory is a no-op.import /etc/caddy/conf.d/*.caddy