From d7d6d0638ca8ab6e481313cf86dd20af1bce2096 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 6 Jun 2026 20:13:19 +0200 Subject: [PATCH] fix(infra): make dev Ollama model-init offline-safe Mirror the prod hardening in the dev stack: guard the model pull with `ollama list | grep -q ` so an already-cached model exits clean without a registry round-trip. Keeps dev and prod on one recipe. Addresses #759 review (Tobias #1). Co-Authored-By: Claude Opus 4.8 --- docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.