Overview
The root docker-compose.yml defines the entire Anar platform: 14 product backends, their dashboards, supporting databases, and the observability infrastructure. A single command brings up the complete development environment.
Quick Start
# Start all products
docker compose up -d
# Start with observability stack (Grafana, Tempo, Loki, Prometheus)
docker compose --profile infra up -d
# Start specific services only
docker compose up -d gateway chat-backend chat-frontend
# View logs
docker compose logs -f chat-backend
# Stop everything
docker compose down
Service Groups
Foundation
| Service | Container | Ports | Dependencies |
|---|---|---|---|
gateway | anar-gateway | 8080 | -- |
website | anar-website | 3000 | -- |
Products with PostgreSQL
These products run their own database containers:
| Service | API Container | DB Container | API Port | Dashboard Port |
|---|---|---|---|---|
chat-backend | anar-chat-api | anar-chat-db | 8001 | 3001 |
guard-backend | anar-guard-api | anar-guard-db | 8002 | 3002 |
voice-backend | anar-voice-api | anar-voice-db | 8003 | 3003 |
Lightweight Products
These products use SQLite or in-memory storage and have no database dependency:
| Service | Container | API Port | Dashboard Port |
|---|---|---|---|
agents-backend | anar-agents-api | 8004 | 3004 |
comply-backend | anar-comply-api | 8005 | 3005 |
eval-backend | anar-eval-api | 8007 | 3007 |
docs-backend | anar-docs-api | 8008 | 3008 |
flow-backend | anar-flow-api | 8009 | 3009 |
insights-backend | anar-insights-api | 8010 | 3011 |
present-backend | anar-present-api | 8011 | 3012 |
translate-backend | anar-translate-api | 8012 | 3013 |
minutes-backend | anar-minutes-api | 8013 | 3014 |
procure-backend | anar-procure-api | 8014 | 3015 |
Infrastructure (Profile: infra)
These services only start when using --profile infra:
| Service | Container | Port | Function |
|---|---|---|---|
langfuse | anar-langfuse | 3010 | LLM observability |
langfuse-db | anar-langfuse-db | -- | Langfuse PostgreSQL |
otel-collector | anar-otel-collector | 4317, 4318, 8889 | Telemetry collection |
grafana | anar-grafana | 3100 | Dashboards |
tempo | anar-tempo | -- | Trace storage |
loki | anar-loki | -- | Log aggregation |
prometheus | anar-prometheus | -- | Metrics storage |
Environment Variables
Create a .env file in the monorepo root. Docker Compose automatically loads it:
# AI Provider Keys (at least one required)
GROQ_API_KEY=gsk_...
AZURE_OPENAI_API_KEY=your-azure-key
AZURE_OPENAI_ENDPOINT=https://your-endpoint.cognitiveservices.azure.com
CORE42_API_KEY=your-core42-key
# Gateway routing (all products use this)
GATEWAY_URL=http://gateway:8080/v1
GATEWAY_API_KEY=your-gateway-key
# LLM provider selection
LLM_PROVIDER=groq
# Database passwords (defaults provided for development)
CHAT_DB_PASSWORD=anar_chat_2024
GUARD_DB_PASSWORD=anar_guard_2024
VOICE_DB_PASSWORD=anar_voice_2024
# JWT secrets (override defaults for production)
CHAT_JWT_SECRET=your-secret
GUARD_JWT_SECRET=your-secret
VOICE_JWT_SECRET=your-secret
AGENTS_JWT_SECRET=your-secret
COMPLY_JWT_SECRET=your-secret
EVAL_JWT_SECRET=your-secret
DOCS_JWT_SECRET=your-secret
FLOW_JWT_SECRET=your-secret
INSIGHTS_JWT_SECRET=your-secret
TRANSLATE_JWT_SECRET=your-secret
MINUTES_JWT_SECRET=your-secret
PROCURE_JWT_SECRET=your-secret
# Grafana
GRAFANA_ADMIN_PASSWORD=admin
Dependency Graph
All product backends depend on the Gateway being healthy before they start:
Dashboard containers depend on their respective backend:
chat-backend → chat-frontend
guard-backend → guard-dashboard
voice-backend → voice-dashboard
...
Volumes
Persistent data is stored in named Docker volumes:
| Volume | Service | Purpose |
|---|---|---|
gateway_data | gateway | Gateway state and configuration |
chat_pgdata | chat-db | Chat PostgreSQL data |
guard_pgdata | guard-db | Guard PostgreSQL data |
voice_pgdata | voice-db | Voice PostgreSQL data |
chromadb_data | chromadb | Vector store data |
docs_uploads | docs-backend | Uploaded documents |
present_uploads | present-backend | Generated presentations |
minutes_uploads | minutes-backend | Meeting audio files |
langfuse_pgdata | langfuse-db | Langfuse PostgreSQL data |
grafana_data | grafana | Grafana dashboards and state |
tempo_data | tempo | Trace data |
loki_data | loki | Log data |
prometheus_data | prometheus | Metrics data |
Health Checks
Every service in the stack has a health check configured. Dashboard containers wait for their backend to be healthy before starting (condition: service_healthy), and all backends wait for the Gateway to be healthy.
Python backends use the /health endpoint provided by harden():
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
PostgreSQL containers use pg_isready:
healthcheck:
test: ["CMD-SHELL", "pg_isready -U anar -d anar_chat"]
interval: 5s
timeout: 5s
retries: 5
Infrastructure services use their native readiness endpoints:
| Service | Health Endpoint |
|---|---|
| OTel Collector | :13133/ (health_check extension) |
| Grafana | :3000/api/health |
| Tempo | :3200/ready |
| Loki | :3100/ready |
| Prometheus | :9090/-/healthy |
| ChromaDB | :8000/api/v1/heartbeat |
Network
All services communicate over a single bridge network named anar-network. Service names resolve as hostnames within the network:
# Inside a container, reach other services by name
GATEWAY_URL=http://gateway:8080/v1
CHAT_URL=http://chat-backend:8001
GUARD_URL=http://guard-backend:8002
Common Operations
Rebuild a Single Service
docker compose build chat-backend
docker compose up -d chat-backend
Reset a Database
docker compose down chat-db
docker volume rm anar-monorepo_chat_pgdata
docker compose up -d chat-db
View Real-Time Logs
docker compose logs -f --tail=50 guard-backend
Check Service Status
docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}"
Resource Requirements
Running all 14 products simultaneously requires approximately 8GB of RAM. For development, start only the products you need with docker compose up -d gateway chat-backend chat-frontend.