Deployment Guide
Overview
Chainr local deployment is orchestrated with Docker Compose from modules/docker-compose.yml.
Current deployment model:
Nginx is the only public entrypoint (
8000:80)Frontend apps (
fe-core,fe-public) run behind NginxCore backend services communicate on internal service networks
Databases are isolated per service domain where available
The dev host on AWS adds the production overlay instead: nothing is published, and Cloudflare reaches nginx only through an outbound-only Cloudflare Tunnel. See Cloudflare Tunnel for how it fits, setting one up for a new environment, and operating it.
Current Compose Topology
Public Entry
nginx→ exposed on host:8000
Core Services
svc-auth(FastAPI, internal)svc-bff(FastAPI, internal)svc-core(FastAPI, exposed on:8080for dev)svc-ai(FastAPI, exposed on:5000for dev)
Frontend Services
fe-core(Vite dev target, internal)fe-public(Vite dev target, internal)
Data Services
redis(shared cache/session store for BFF/auth path)postgres-core(dedicated database forsvc-core, host:5432)postgres-ai(dedicated database forsvc-ai, host:5433)
Database Design Status
The target design is one dedicated Postgres database per core service.
Current status:
svc-core→ dedicated Postgres is in place (postgres-core)svc-ai→ dedicated Postgres is in place (postgres-ai)svc-auth→ dedicated Postgres is planned, not yet added in Composesvc-bff→ dedicated Postgres is planned, not yet added in Compose
Networks
Compose network segmentation currently uses:
frontend-networkfor Nginx ↔ frontend appsbff-networkfor Nginx/BFF/auth/Redis interactionsbackend-networkfor service-to-service API callsdb-networkforsvc-core↔postgres-coreai-networkforsvc-aiand AI data dependenciespostgres-core-external,postgres-ai-externalfor dev tooling accessai-egress-networkfor everythingsvc-aisends out: model calls, web search, page fetches, tools
Service Startup Notes
nginxwaits forsvc-auth,svc-bff, and frontend servicessvc-corewaits forpostgres-corehealthsvc-aiwaits forpostgres-aihealthRedis is consumed by
svc-authandsvc-bff
Migration Notes
Each service that owns a database should manage migrations independently (Alembic in service repo).
Current migration-enabled services:
svc-core(Postgres + Alembic)svc-ai(Postgres + Alembic)
Planned next step:
Add dedicated Postgres + migration flow for
svc-authandsvc-bff