Files
rag-technical-docs-assistant/docker-compose.yml
T
11linear11 42f5b9e854 fix(ops): harden backend startup and worker recovery
Install modular API, voice and embedding extras and use the supported single-process server entrypoint. Drain worker SIGTERM shutdown within the Compose grace period.

Add isolated HTTPS embedding fixtures, bounded intake execution and reproducible account, publication, restart, lease-recovery and shutdown acceptance. Eight operational scenarios passed with zero real-provider calls.
2026-10-09 17:44:04 -04:00

95 lines
2.9 KiB
YAML

services:
db:
image: pgvector/pgvector:pg16
container_name: rag-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-rag}
POSTGRES_USER: ${POSTGRES_USER:-rag}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-rag_password}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-rag} -d ${POSTGRES_DB:-rag}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
migrations:
build:
context: .
dockerfile: Dockerfile
container_name: rag-migrations
restart: "no"
command: alembic upgrade head
env_file:
- .env
environment:
- INGEST_DATABASE_URL=postgresql+psycopg://${POSTGRES_USER:-rag}:${POSTGRES_PASSWORD:-rag_password}@db:5432/${POSTGRES_DB:-rag}
- INGEST_EMBEDDING_ENDPOINT=${INGEST_EMBEDDING_ENDPOINT:-http://host.docker.internal:11434/v1}
- INGEST_OCR_REVIEW_REQUIRED=${INGEST_OCR_REVIEW_REQUIRED:-true}
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
db:
condition: service_healthy
api:
build:
context: .
dockerfile: Dockerfile
container_name: rag-api
restart: unless-stopped
command: python -m app.server --host 0.0.0.0 --port 8000
ports:
- "${API_PORT:-8080}:8000"
env_file:
- .env
environment:
- INGEST_DATABASE_URL=postgresql+psycopg://${POSTGRES_USER:-rag}:${POSTGRES_PASSWORD:-rag_password}@db:5432/${POSTGRES_DB:-rag}
- INGEST_EMBEDDING_ENDPOINT=${INGEST_EMBEDDING_ENDPOINT:-http://host.docker.internal:11434/v1}
- INGEST_OCR_REVIEW_REQUIRED=${INGEST_OCR_REVIEW_REQUIRED:-true}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./data/documents:/app/data/documents
- ./data/vector_db:/app/data/vector_db
- ./data/originals:/app/data/originals
- ./data/extractions:/app/data/extractions
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
worker:
build:
context: .
dockerfile: Dockerfile
container_name: rag-worker
restart: unless-stopped
stop_grace_period: 90s
command: python -m app.worker
env_file:
- .env
environment:
- INGEST_DATABASE_URL=postgresql+psycopg://${POSTGRES_USER:-rag}:${POSTGRES_PASSWORD:-rag_password}@db:5432/${POSTGRES_DB:-rag}
- INGEST_EMBEDDING_ENDPOINT=${INGEST_EMBEDDING_ENDPOINT:-http://host.docker.internal:11434/v1}
- INGEST_OCR_REVIEW_REQUIRED=${INGEST_OCR_REVIEW_REQUIRED:-true}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./data/originals:/app/data/originals
- ./data/extractions:/app/data/extractions
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
volumes:
postgres_data: