Skip to content

Deployment ​

The full production runbook — architecture, environment files, backup/restore and security notes — lives in deploy/README.md. This page is a quick index to the actual infrastructure and scripts.

Compose stacks ​

FilePurpose
docker-compose.ymlDevelopment stack
docker-compose.prod.ymlProduction (Caddy, API, worker, custody, PostgreSQL, Redis, backup)
docker-compose.e2e.ymlDocker E2E stack with Anvil (SQLite)

Production hard-requires PostgreSQL.

Production ​

bash
# 1. Configure environment (two files: public config + custody signing keys)
cp .env.example .env.production
cp deploy/.env.custody.example .env.custody
chmod 600 .env.custody

# 2. Deploy and observe
npm run deploy:prod        # up -d --build
npm run deploy:prod:ps     # status
npm run deploy:prod:logs   # follow logs
npm run deploy:prod:down   # stop

# 3. Backups
npm run db:backup          # one-off pg_dump via the backup service
npm run db:restore:test    # restore the latest backup into a throwaway DB

Only Caddy binds host ports; the API, worker, custody, PostgreSQL and Redis run on the internal network. Treasury signing keys are supplied only to the custody service via .env.custody; the public services never declare signing material.

Infrastructure & scripts ​

PathRole
deploy/CaddyfileReverse proxy, TLS, security headers, WebSocket passthrough
deploy/.env.custody.exampleTemplate for the custody-only signing environment
deploy/postgres-backup.shScheduled pg_dump (mounted as /backup.sh)
deploy/postgres-restore.shRestore a backup into the production database
deploy/postgres-restore-test.shRestore-integrity check against a throwaway database

CI/CD workflows ​

WorkflowTriggersPurpose
ci.ymlpush/PR to main, developLint, format, build, migrations, tests, Docker build
publish.ymlrelease / dispatchBuild + provenance-publish npm packages
docker-publish.ymlrelease / dispatchBuild & push the multi-arch image to GHCR
docs.ymlpush to main on docs/** / dispatchBuild VitePress and deploy to GitHub Pages

Health checks ​

CheckCommand / URLExpects
API processdocker compose psUp + healthy
HTTPcurl -sf https://<host>/health{"status":"ok"}
Readinesscurl -sf https://<host>/ready200 when ready
Redisredis-cli -u $REDIS_URL pingPONG
Backupsnpm run deploy:prod:ps shows backupUp

Documentation site ​

The site builds with VitePress from /docs and is deployed to GitHub Pages by docs.yml:

bash
cd docs
npm install
npm run docs:dev       # local preview
npm run docs:build     # production build → docs/.vitepress/dist

Released under the MIT License.