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: