From de051fb2e71408b457b2f98aad8847d45c510351 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Date: Thu, 14 May 2026 12:16:48 -0400 Subject: [PATCH] fix: remove qdrant healthcheck, use wait-loop in our own containers qdrant/qdrant:v1.9.0 does not ship curl or wget, so CMD healthchecks always exit 127 (not found) and the container is immediately marked unhealthy regardless of whether Qdrant is actually running. Fix: remove the healthcheck from the qdrant service entirely. Instead, rag-api and indexer now loop on `curl http://qdrant:6333/` (curl is installed in our own python:3.11-slim image via the Dockerfile) before starting the main process. Also removes the obsolete `version` key. Co-Authored-By: Claude Sonnet 4.6 --- docker-compose.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bd7de80..59bc0f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - # ─── Odoo 18 RAG Stack ──────────────────────────────────────────────────────── # rag-api:8000 ──► qdrant:6333 (internal docker network) # rag-api ──► miaai:11434 (direct outbound to Ollama) @@ -28,20 +26,20 @@ services: QDRANT__LOG_LEVEL: INFO networks: - rag_net - healthcheck: - test: ["CMD", "curl", "-sf", "http://localhost:6333/"] - interval: 15s - timeout: 10s - retries: 5 - start_period: 30s + # No healthcheck — qdrant image does not ship curl/wget. + # Dependent services use a wait-loop via our own image which has curl. rag-api: build: . container_name: odoo18-rag-api restart: unless-stopped depends_on: - qdrant: - condition: service_healthy + - qdrant + # Wait for Qdrant to accept HTTP before starting uvicorn + command: > + sh -c "until curl -sf http://qdrant:6333/ > /dev/null 2>&1; + do echo 'waiting for qdrant...'; sleep 3; done + && uvicorn api.main:app --host 0.0.0.0 --port 8000 --workers 2" ports: - "8000:8000" environment: @@ -57,11 +55,6 @@ services: - "miaai:192.168.2.9" networks: - rag_net - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] - interval: 30s - timeout: 10s - retries: 3 scraper: build: . @@ -79,10 +72,13 @@ services: build: . container_name: odoo18-indexer profiles: ["indexer"] - command: python /app/indexer/indexer.py + # Wait for Qdrant before indexing + command: > + sh -c "until curl -sf http://qdrant:6333/ > /dev/null 2>&1; + do echo 'waiting for qdrant...'; sleep 3; done + && python /app/indexer/indexer.py" depends_on: - qdrant: - condition: service_healthy + - qdrant volumes: - ./data:/app/data extra_hosts: