Skip to content

Commit d419d82

Browse files
committed
fix(deploy): fail remote-up if qwen-search is an exit-0 stub
Detect command override via compose JSON and prompt operator to remove it so the image ENTRYPOINT runs the HTTP server. Made-with: Cursor
1 parent f388a19 commit d419d82

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

scripts/remote-up-prod.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,36 @@ if ! grep -q '^ qwen-search:' docker-compose.prod.yml; then
1717
exit 1
1818
fi
1919

20+
# Reject no-op qwen-search stubs (e.g. command: sh -c 'exit 0') — they exit before the HTTP server runs.
21+
echo "=== validate qwen-search (must use image ENTRYPOINT, not exit 0 stub) ==="
22+
if docker compose config --format json 2>/dev/null | python3 -c "
23+
import json, sys
24+
c = json.load(sys.stdin)
25+
qs = c.get('services', {}).get('qwen-search')
26+
if not qs:
27+
print('ERROR: resolved config missing qwen-search', file=sys.stderr)
28+
sys.exit(1)
29+
cmd = qs.get('command')
30+
if cmd is None:
31+
print('qwen-search: no command override — OK (ENTRYPOINT runs)')
32+
sys.exit(0)
33+
parts = cmd if isinstance(cmd, list) else [cmd]
34+
flat = ' '.join(str(p) for p in parts)
35+
print('qwen-search command:', flat)
36+
if 'exit 0' in flat:
37+
print(
38+
'ERROR: qwen-search uses a no-op command. Delete any \"command:\" block under qwen-search in docker-compose.prod.yml, then redeploy.',
39+
file=sys.stderr,
40+
)
41+
sys.exit(1)
42+
sys.exit(0)
43+
"; then
44+
:
45+
else
46+
echo "ERROR: qwen-search command check failed (see above)." >&2
47+
exit 1
48+
fi
49+
2050
echo "=== docker compose config --services ==="
2151
docker compose config --services
2252

0 commit comments

Comments
 (0)