- Multi-stage Dockerfile (deps → build → runner) for optimized production image - Enable Next.js standalone output for minimal container size - Add .dockerignore to exclude dev artifacts from build context - Add frontend service to docker-compose.yml with API dependency https://claude.ai/code/session_01QU6gpDgMtX4b9k1UXTivEf
69 lines
2 KiB
YAML
69 lines
2 KiB
YAML
version: "3.9"
|
|
|
|
# CouncilOS — local development environment
|
|
# Usage:
|
|
# docker compose up -d # Start all services
|
|
# docker compose down # Stop all services
|
|
# docker compose logs -f api # Follow API logs
|
|
|
|
services:
|
|
# ---------------------------------------------------------------------------
|
|
# PostgreSQL — stores council blueprints (used from Phase 2)
|
|
# ---------------------------------------------------------------------------
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: councilOS
|
|
POSTGRES_USER: user
|
|
POSTGRES_PASSWORD: password
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U user -d councilOS"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# CouncilOS API — FastAPI + LangGraph backend
|
|
# ---------------------------------------------------------------------------
|
|
api:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8000:8000"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://user:password@db:5432/councilOS
|
|
volumes:
|
|
- ./backend:/app
|
|
- chroma_data:/app/chroma_db
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# CouncilOS Frontend — Next.js + React Flow UI
|
|
# ---------------------------------------------------------------------------
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
NEXT_PUBLIC_API_URL: http://api:8000
|
|
depends_on:
|
|
- api
|
|
|
|
volumes:
|
|
postgres_data:
|
|
chroma_data:
|