Files
provenance/deploy/Caddyfile
T
justin 0b5c3b260a Add self-host compose stack (Postgres, MinIO, backend, Caddy)
One env-driven compose stack stands up the whole system per ARCHITECTURE §2/§12. Postgres uses the pgvector image (pgvector + pg_trgm in contrib); MinIO is the S3-compatible store; Caddy reverse-proxies /api/* and /health* to the backend with an env-driven site address (':80' local, a domain for auto-HTTPS, or plain HTTP behind a Cloudflare Tunnel). Healthchecks and depends_on gate startup order.

.env.example documents twelve-factor config (DB, S3, SMTP, Caddy, model keys) with placeholders; no secrets in the repo. Verified end-to-end on the deploy target: all services healthy, /health/ready green against real Postgres.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Justin Paul <justin@jpaul.me>
2026-06-06 10:17:12 -04:00

26 lines
753 B
Caddyfile

# Provenance edge. Site address is env-driven: ':80' for local http://localhost,
# a domain in production for automatic HTTPS. Behind a Cloudflare Tunnel you can
# keep this on plain HTTP and let the tunnel terminate TLS.
{$PROVENANCE_SITE_ADDRESS::80} {
encode gzip
# Versioned API surface (FastAPI). The assistant mounts under /assistant later.
handle /api/* {
reverse_proxy backend:8000
}
# Liveness/readiness probes, proxied for external monitoring.
handle /health* {
reverse_proxy backend:8000
}
# Frontend (Next.js) — not yet deployed in Phase 0. Uncomment when it lands.
# handle {
# reverse_proxy frontend:3000
# }
handle {
respond "Provenance — Phase 0. Backend health at /health; frontend not yet deployed." 200
}
}