Skip to main content
A
Docs

Docker Compose

Run all 14 Anar products locally with Docker Compose including the observability stack.

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

ServiceContainerPortsDependencies
gatewayanar-gateway8080--
websiteanar-website3000--

Products with PostgreSQL

These products run their own database containers:

ServiceAPI ContainerDB ContainerAPI PortDashboard Port
chat-backendanar-chat-apianar-chat-db80013001
guard-backendanar-guard-apianar-guard-db80023002
voice-backendanar-voice-apianar-voice-db80033003

Lightweight Products

These products use SQLite or in-memory storage and have no database dependency:

ServiceContainerAPI PortDashboard Port
agents-backendanar-agents-api80043004
comply-backendanar-comply-api80053005
eval-backendanar-eval-api80073007
docs-backendanar-docs-api80083008
flow-backendanar-flow-api80093009
insights-backendanar-insights-api80103011
present-backendanar-present-api80113012
translate-backendanar-translate-api80123013
minutes-backendanar-minutes-api80133014
procure-backendanar-procure-api80143015

Infrastructure (Profile: infra)

These services only start when using --profile infra:

ServiceContainerPortFunction
langfuseanar-langfuse3010LLM observability
langfuse-dbanar-langfuse-db--Langfuse PostgreSQL
otel-collectoranar-otel-collector4317, 4318, 8889Telemetry collection
grafanaanar-grafana3100Dashboards
tempoanar-tempo--Trace storage
lokianar-loki--Log aggregation
prometheusanar-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:

VolumeServicePurpose
gateway_datagatewayGateway state and configuration
chat_pgdatachat-dbChat PostgreSQL data
guard_pgdataguard-dbGuard PostgreSQL data
voice_pgdatavoice-dbVoice PostgreSQL data
chromadb_datachromadbVector store data
docs_uploadsdocs-backendUploaded documents
present_uploadspresent-backendGenerated presentations
minutes_uploadsminutes-backendMeeting audio files
langfuse_pgdatalangfuse-dbLangfuse PostgreSQL data
grafana_datagrafanaGrafana dashboards and state
tempo_datatempoTrace data
loki_datalokiLog data
prometheus_dataprometheusMetrics 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:

ServiceHealth 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.