Deployment & Ops4 min read
Docker Compose Deployment & Scaling
Deploy Atreya-MD Control Plane, ARQ workers, PostgreSQL 17, Redis 7, and MinIO using Docker Compose.
Container Topology
Docker Composeapi— FastAPI Control Plane serving REST/SSE/api/v1and static React 19 SPA.worker— Stateless ARQ worker containers executing the 5-stage Constrained Blackboard Harness.postgres— PostgreSQL 17 (pgvector/pgvector:pg17) storing jobs, checkpoints,.mdversions, catalog, and hash-chained audit logs.redis— Redis 7 job queue & live SSE pub/sub broker.minio(optional profile) — S3-compatible object storage for Parquet/CSV batches and catalog archives.
Docker Compose Service Architecture
:8000
api (FastAPI + SPA)
Serves UI, REST v1 & SSE streams
scalable
worker (ARQ x N)
Runs Constrained Blackboard Loop
:5432
postgres (pg17 + pgvector)
98k catalog, jobs, audit_logs
:6379 / :9000
redis 7 + MinIO
Queue & streaming Parquet store
Launch in 3 Commands
- Place
customer.licandpublic_key.peminside./keys/. - Configure
.envwith your PostgreSQL credentials and HIPAA-BAA LLM endpoint. - Start core services with
docker compose up -d(add--profile storageto include MinIO).
Terminal — VPC Docker Compose Launch
bash
# 1. Stage offline Ed25519 license & vendor public key
mkdir -p ./keys
cp /secure/customer.lic ./keys/customer.lic
cp /secure/public_key.pem ./keys/public_key.pem
# 2. Configure environment variables
cp .env.example .env
# 3. Launch Control Plane + ARQ Workers + Postgres 17 (pgvector) + Redis
docker compose up -d
# 4. Optional: include local MinIO S3-compatible object storage
docker compose --profile storage up -dHorizontal Worker Scaling
- Scale ARQ workers horizontally up to your license's
max_workersentitlement. - Concurrency is race-free:
DatabaseManager.init_schema()locks migrations withpg_advisory_xact_lock(84729103). - Use exact-hash caching + Polars/PyArrow streaming to process 100k+ row Parquet batches with constant RAM.
Scale ARQ Coding Workers
bash
# Scale to 16 parallel coding workers (must be <= license max_workers)
docker compose up -d --scale worker=16
# Verify health and live worker pool telemetry
curl -s http://localhost:8000/api/v1/system/health | jqSize PostgreSQL max_connections >= (api_replicas + worker_replicas) * 10 to prevent pool starvation during peak month-end batches.