fix(docker): use glibc base image so local embeddings load#97
Merged
Conversation
@huggingface/transformers eagerly requires the native onnxruntime-node at import, whose prebuilt binary is glibc-only and cannot dlopen on Alpine/musl (fails with ERR_DLOPEN_FAILED, and gcompat does not provide the glibc fortify symbols it needs). With EMBEDDING_PROVIDER=local this crashed the app on boot. Switch both Dockerfile stages to node:22-slim (glibc), where onnxruntime-node loads natively, which is also faster than the WASM fallback. The local embedding adapter now uses the default native backend instead of forcing WASM. The compose healthcheck moves from wget (absent on slim) to a node fetch one-liner. Verified on the target host: app boots clean and an in-container embed returns a 384-dim vector.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
EMBEDDING_PROVIDER=local, the app crash-loops on boot.@huggingface/transformerseagerlyrequires the nativeonnxruntime-nodeat import time; its prebuilt binary is glibc-only and can'tdlopenon Alpine/musl:device: 'wasm'can't help because the crash happens at import, before the pipeline runs. gcompat doesn't implement the glibc fortify (*_chk) symbols.Fix
node:22-alpine->node:22-slim(glibc). onnxruntime-node loads natively (and faster than WASM).wget(absent on slim) -> anodefetch one-liner.Verified on the target host
App boots clean (no dlopen errors,
/health/ready200), and an in-container embed returns dim: 384. Full suite 174/174, tsc/eslint/build clean.