| # Docker Compose for local development — PostgreSQL only. | |
| # Cloud deployments (HF Spaces) use Supabase instead. | |
| # | |
| # Usage: | |
| # docker compose up -d postgres | |
| # # Then set DATABASE_URL=postgresql://novel_reader:changeme@localhost:5432/novel_reader in .env | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| environment: | |
| POSTGRES_DB: ${POSTGRES_DB:-novel_reader} | |
| POSTGRES_USER: ${POSTGRES_USER:-novel_reader} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} | |
| ports: | |
| - "${POSTGRES_PORT:-5432}:5432" | |
| volumes: | |
| - pgdata:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-novel_reader}"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| restart: unless-stopped | |
| # Qdrant vector database for the temporal-aware RAG layer. | |
| # The main app reaches it at http://localhost:6333 (or http://qdrant:6333 | |
| # from inside the compose network). For a managed cluster instead, leave this | |
| # service stopped and set QDRANT_URL / QDRANT_API_KEY in .env. | |
| qdrant: | |
| image: qdrant/qdrant:latest | |
| ports: | |
| - "${QDRANT_PORT:-6333}:6333" | |
| - "${QDRANT_GRPC_PORT:-6334}:6334" | |
| volumes: | |
| - qdrant_data:/qdrant/storage | |
| restart: unless-stopped | |
| # Chatterbox-Turbo TTS microservice (GPU). | |
| # Requires the NVIDIA Container Toolkit on the host. | |
| # Build context is the repo root so the image can install the local | |
| # chatterbox package; the main app reaches it at http://localhost:8070 | |
| # (or http://tts:8070 from inside the compose network). | |
| tts: | |
| build: | |
| context: . | |
| dockerfile: tts_service/Dockerfile | |
| ports: | |
| - "${TTS_PORT:-8070}:8070" | |
| environment: | |
| TTS_DEVICE: ${TTS_DEVICE:-cuda} | |
| VOICE_SAMPLES_DIR: /voice_samples | |
| TTS_CACHE_DIR: /data/tts_cache | |
| HF_HOME: /data/hf | |
| volumes: | |
| - ./voice_samples:/voice_samples:ro | |
| - ./data/tts_cache:/data/tts_cache | |
| - ./data/hf:/data/hf | |
| deploy: | |
| resources: | |
| reservations: | |
| devices: | |
| - driver: nvidia | |
| count: all | |
| capabilities: [gpu] | |
| restart: unless-stopped | |
| volumes: | |
| pgdata: | |
| qdrant_data: | |