Deployment#
Components#
| Service | Image / command | State |
|---|---|---|
| API | infrastructure/docker/api.Dockerfile → rvc-api |
stateless (+ local object cache volume) |
| Worker | same image → rvc-worker |
stateless |
| Migrations | same image → alembic upgrade head (run before each release) |
— |
| Web | apps/web/Dockerfile (build args RVC_API_URL; optional NEXT_PUBLIC_RVC_DOCS_URL, NEXT_PUBLIC_RVC_REPO_URL for the landing page's docs/source links) |
stateless |
| PostgreSQL 16 + pgvector | authoritative metadata | back up |
| S3-compatible storage | object bytes (authoritative with RVC_STORAGE_BACKEND=s3) |
back up |
| Redis | rate limiting only | disposable |
docker compose up --build runs the whole stack locally with SeaweedFS as the S3 service
(MinIO's public images were not pullable from this environment; any S3 API works).
Configuration#
See .env.example. With RVC_ENV=production the API refuses to start unless the secret key is
≥ 32 random characters, the database is PostgreSQL, JWT auth has a secret, and S3 credentials
are present. Health: GET /health (liveness), GET /ready (database + storage).
Logs are JSON lines on stdout with request ids (X-Request-ID is propagated).
Error monitoring: set RVC_SENTRY_DSN and install sentry-sdk in the image.
TLS / reverse proxy#
Terminate TLS at a reverse proxy and route / to web, /api/ to the API (or let the web
server proxy /api). Example (Caddy):
research.example.org {
reverse_proxy /api/* api:8000
reverse_proxy web:3000
}
Set RVC_PUBLIC_URL=https://research.example.org and RVC_FORWARDED_ALLOW_IPS to the proxy
address so client IPs (rate limits, audit logs) are correct. Cookies become Secure
automatically when the public URL is https.
Backup and restore#
- PostgreSQL:
pg_dump -Fc rvc > rvc-$(date +%F).dump; restore withpg_restore -d rvc. - Objects: replicate the bucket (
aws s3 sync/rclone sync) or snapshot the volume. Objects are immutable and content-addressed, so incremental copies are safe and can be verified (object key = sha256). - Order: back up the database first, then objects (objects are only ever added, so a newer object set is always a superset of what the database references).
- After restore:
rvc cloneany project and runrvc fsckto verify end-to-end integrity. Derived index tables can be rebuilt by re-enqueuingingestjobs for each repository. Researchers can always export locally withrvc export repo.rvcbundle/rvc clone.
Upgrades#
Run migrations (alembic upgrade head) before rolling out new API/worker images. The
repository format version is checked by clients; incompatible format changes require an
explicit migration (none exist yet).
Status of this repository's deployment artifacts#
The API image was built and smoke-tested once (container start + /ready), which exposed a
packaging bug; the fix (install from built wheels) has not been rebuilt/verified since.
The web image and the full docker compose stack have not been run in this environment.
docker compose config validates.