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 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
version: "3.9"
|
|
||||||
|
|
||||||
# ─── Odoo 18 RAG Stack ────────────────────────────────────────────────────────
|
# ─── Odoo 18 RAG Stack ────────────────────────────────────────────────────────
|
||||||
# rag-api:8000 ──► qdrant:6333 (internal docker network)
|
# rag-api:8000 ──► qdrant:6333 (internal docker network)
|
||||||
# rag-api ──► miaai:11434 (direct outbound to Ollama)
|
# rag-api ──► miaai:11434 (direct outbound to Ollama)
|
||||||
@@ -28,20 +26,20 @@ services:
|
|||||||
QDRANT__LOG_LEVEL: INFO
|
QDRANT__LOG_LEVEL: INFO
|
||||||
networks:
|
networks:
|
||||||
- rag_net
|
- rag_net
|
||||||
healthcheck:
|
# No healthcheck — qdrant image does not ship curl/wget.
|
||||||
test: ["CMD", "curl", "-sf", "http://localhost:6333/"]
|
# Dependent services use a wait-loop via our own image which has curl.
|
||||||
interval: 15s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 5
|
|
||||||
start_period: 30s
|
|
||||||
|
|
||||||
rag-api:
|
rag-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: odoo18-rag-api
|
container_name: odoo18-rag-api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
qdrant:
|
- qdrant
|
||||||
condition: service_healthy
|
# 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:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
environment:
|
environment:
|
||||||
@@ -57,11 +55,6 @@ services:
|
|||||||
- "miaai:192.168.2.9"
|
- "miaai:192.168.2.9"
|
||||||
networks:
|
networks:
|
||||||
- rag_net
|
- rag_net
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
|
|
||||||
scraper:
|
scraper:
|
||||||
build: .
|
build: .
|
||||||
@@ -79,10 +72,13 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
container_name: odoo18-indexer
|
container_name: odoo18-indexer
|
||||||
profiles: ["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:
|
depends_on:
|
||||||
qdrant:
|
- qdrant
|
||||||
condition: service_healthy
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
|||||||
Reference in New Issue
Block a user