services: # === .NET AI AGENT API === api: build: context: . dockerfile: Dockerfile container_name: svrnty-api ports: # Temporarily disabled gRPC (ARM64 Mac build issues) # - "6000:6000" # gRPC - "6001:6001" # HTTP environment: - ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT:-Production} # HTTP-only mode (gRPC temporarily disabled) - ASPNETCORE_URLS=http://+:6001 - ASPNETCORE_HTTPS_PORTS= - ASPNETCORE_HTTP_PORTS=6001 - ConnectionStrings__DefaultConnection=${CONNECTION_STRING_SVRNTY} - Ollama__BaseUrl=${OLLAMA_BASE_URL} - Ollama__Model=${OLLAMA_MODEL} - Langfuse__PublicKey=${LANGFUSE_PUBLIC_KEY} - Langfuse__SecretKey=${LANGFUSE_SECRET_KEY} - Langfuse__OtlpEndpoint=${LANGFUSE_OTLP_ENDPOINT} depends_on: postgres: condition: service_healthy ollama: condition: service_started langfuse: condition: service_healthy networks: - agent-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:6001/health"] interval: 30s timeout: 10s retries: 5 start_period: 40s restart: unless-stopped # === OLLAMA LLM === ollama: image: ollama/ollama:latest container_name: ollama ports: - "11434:11434" volumes: - ollama_models:/root/.ollama environment: - OLLAMA_HOST=0.0.0.0 networks: - agent-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"] interval: 30s timeout: 10s retries: 5 start_period: 10s restart: unless-stopped # === LANGFUSE OBSERVABILITY === langfuse: # Using v2 - v3 requires ClickHouse which adds complexity image: langfuse/langfuse:2 container_name: langfuse ports: - "3000:3000" environment: - DATABASE_URL=${CONNECTION_STRING_LANGFUSE} - DIRECT_URL=${CONNECTION_STRING_LANGFUSE} - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} - SALT=${SALT} - ENCRYPTION_KEY=${ENCRYPTION_KEY} - LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=true - NEXTAUTH_URL=http://localhost:3000 - TELEMETRY_ENABLED=false - NODE_ENV=production depends_on: postgres: condition: service_healthy networks: - agent-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] interval: 30s timeout: 10s retries: 5 start_period: 60s restart: unless-stopped # === POSTGRESQL DATABASE === postgres: image: postgres:15-alpine container_name: postgres environment: - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_DB=${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data - ./docker/configs/init-db.sql:/docker-entrypoint-initdb.d/init.sql ports: - "5432:5432" networks: - agent-network healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped networks: agent-network: driver: bridge name: svrnty-agent-network volumes: ollama_models: name: svrnty-ollama-models postgres_data: name: svrnty-postgres-data