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.
This commit is contained in:
11linear11
2026-10-09 17:44:04 -04:00
parent a73a496c54
commit 42f5b9e854
9 changed files with 760 additions and 5 deletions
+5 -1
View File
@@ -30,6 +30,7 @@ services:
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:
@@ -42,7 +43,7 @@ services:
dockerfile: Dockerfile
container_name: rag-api
restart: unless-stopped
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
command: python -m app.server --host 0.0.0.0 --port 8000
ports:
- "${API_PORT:-8080}:8000"
env_file:
@@ -50,6 +51,7 @@ services:
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:
@@ -69,12 +71,14 @@ services:
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: