diligence/docker-compose.yml
Claude a6e6e2f54f v2.0: dual deployment — pip install (SQLite) + Docker (PostgreSQL)
Architecture:
- Moved backend/app/ to diligence/ Python package
- Dialect-agnostic models (Uuid + JSON, no PostgreSQL imports)
- Auto-detect database: empty DATABASE_URL → SQLite at ~/.diligence/data.db
- Cross-dialect migrations (inspector-based, no raw PostgreSQL DDL)
- FastAPI serves pre-built React frontend for pip path
- CLI entry point: diligence [--port] [--no-browser] [--data-dir]
- pyproject.toml with optional deps: [postgres], [mcp], [dev]
- Docker path unchanged: docker compose up -d

pip install path: pip install . && diligence
Docker path: ./setup.sh && docker compose up -d
2026-07-01 03:30:12 +00:00

65 lines
1.5 KiB
YAML

services:
frontend:
build: ./frontend
restart: unless-stopped
ports:
- "80:80"
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
backend:
build:
context: .
dockerfile: backend/Dockerfile
restart: unless-stopped
env_file: .env
environment:
- DATABASE_URL=postgresql+asyncpg://fitness@fitness-db:5432/fitness_rewards
- BASE_URL=${BASE_URL:-http://localhost}
- API_TOKEN=${API_TOKEN:-}
depends_on:
fitness-db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
mcp-connector:
build: ./mcp-connector
restart: unless-stopped
environment:
- FITNESS_API_URL=http://backend:8000
- API_TOKEN=${API_TOKEN:-}
depends_on:
backend:
condition: service_healthy
ports:
- "3001:3001"
fitness-db:
image: postgres:16-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER:-fitness}
- POSTGRES_DB=${DB_NAME:-fitness_rewards}
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- fitness_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-fitness}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
fitness_db_data: