fix: use list-form command with literal block to avoid sh syntax error

YAML folded scalar (>) preserves newlines on more-indented continuation
lines, so the shell received && on its own line which is invalid in
dash. Switched to the list form [/bin/sh, -c, |script|] so Docker
passes the script verbatim to sh -c without double-wrapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Carlos Garcia
2026-05-14 12:20:08 -04:00
parent de051fb2e7
commit 3d94c4eb25

View File

@@ -27,7 +27,7 @@ services:
networks:
- rag_net
# No healthcheck — qdrant image does not ship curl/wget.
# Dependent services use a wait-loop via our own image which has curl.
# Dependent services wait via a loop in our own image (which has curl).
rag-api:
build: .
@@ -35,11 +35,15 @@ services:
restart: unless-stopped
depends_on:
- 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"
command:
- /bin/sh
- -c
- |
until curl -sf http://qdrant:6333/ > /dev/null 2>&1; do
echo 'waiting for qdrant...'
sleep 3
done
exec uvicorn api.main:app --host 0.0.0.0 --port 8000 --workers 2
ports:
- "8000:8000"
environment:
@@ -72,11 +76,15 @@ services:
build: .
container_name: odoo18-indexer
profiles: ["indexer"]
# 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"
command:
- /bin/sh
- -c
- |
until curl -sf http://qdrant:6333/ > /dev/null 2>&1; do
echo 'waiting for qdrant...'
sleep 3
done
exec python /app/indexer/indexer.py
depends_on:
- qdrant
volumes: