Avoid redundant TinySearch browser install

This commit is contained in:
Mikei386
2026-08-21 13:55:07 +02:00
parent 29d65dc223
commit ccf0efd059
+9 -2
View File
@@ -31,14 +31,21 @@ fi
# TinySearch keeps the embedding bundle outside the container. Download it
# once on a fresh host; subsequent rebuilds reuse the named volume.
#
# Do not call `tinysearch setup` here. The pinned container image already
# contains a complete Playwright/Chromium installation, while that command
# unconditionally tries to install Chromium again. On IPv4-only hosts this
# redundant download can hang indefinitely. Prepare only the persistent ONNX
# bundle that is actually absent on a fresh installation.
docker volume create mike-ai-tools_tinysearch-models >/dev/null
tiny_image="marcellm01/tinysearch@sha256:5a03d5a1f1b0fabe48f2a26e05db4a84bcb611106a57ec51e42db4549976aa9c"
if ! docker run --rm --entrypoint test \
-v mike-ai-tools_tinysearch-models:/data/models "$tiny_image" \
-f /data/models/all-minilm-l6-v2-onnx/model.onnx; then
echo "TinySearch-Modell wird einmalig geladen."
docker run --rm -v mike-ai-tools_tinysearch-models:/data/models \
"$tiny_image" tinysearch setup
docker run --rm --entrypoint python \
-v mike-ai-tools_tinysearch-models:/data/models "$tiny_image" \
-c 'from tinysearch.services.onnx_bundle_service import ensure_onnx_bundle_sync; ensure_onnx_bundle_sync("fast")'
fi
"${COMPOSE[@]}" "${profiles[@]}" up -d --build