diff --git a/docker-compose.yml b/docker-compose.yml index 94df5bd7..f9e618ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -163,9 +163,11 @@ services: - no-new-privileges:true # The image ENTRYPOINT is `ollama`, so override it to a shell; the image has # no curl, so readiness is probed with `ollama list` instead of a curl loop. + # The pull is guarded by a `grep` on the cached model list so an already-cached + # model exits clean without a registry round-trip (offline-safe re-up). entrypoint: ["/bin/sh", "-c"] command: - - "ollama serve & until ollama list >/dev/null 2>&1; do sleep 1; done && ollama pull qwen2.5:7b-instruct-q4_K_M" + - "ollama serve & until ollama list >/dev/null 2>&1; do sleep 1; done && (ollama list | grep -q 'qwen2.5:7b-instruct-q4_K_M' || ollama pull qwen2.5:7b-instruct-q4_K_M)" # --- Ollama: LLM inference server --- # Serves the pre-pulled model for NL search inference.