From cc61211aed49a777b517945fb34ed7ee4d7b99df Mon Sep 17 00:00:00 2001 From: Quoc-Anh Nguyen <9426721+imcvampire@users.noreply.github.com> Date: Sat, 13 Jun 2026 14:08:46 +0300 Subject: [PATCH] fly: Enhance Dockerfile with local embeddings installation Added installation of optional peer dependency for local embeddings and preloaded model weights during Docker build. --- deploy/fly/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deploy/fly/Dockerfile b/deploy/fly/Dockerfile index 89257f937..9942be17e 100644 --- a/deploy/fly/Dockerfile +++ b/deploy/fly/Dockerfile @@ -25,6 +25,13 @@ RUN printf '{"name":"agentmemory-deploy","version":"1.0.0","private":true,"overr && npm install "@agentmemory/agentmemory@${AGENTMEMORY_VERSION}" --omit=optional --no-fund --no-audit \ && ln -s /opt/agentmemory/node_modules/.bin/agentmemory /usr/local/bin/agentmemory +# Local embeddings (Xenova/all-MiniLM-L6-v2, 384-dim). The optional peer dep +# is omitted by --omit=optional above, so install it explicitly and preload +# the model weights at build time (no runtime HuggingFace download on cold +# start, no volume cache needed). +RUN npm install @xenova/transformers --no-fund --no-audit \ + && node -e "const {pipeline}=require('@xenova/transformers');pipeline('feature-extraction','Xenova/all-MiniLM-L6-v2').then(()=>console.log('agentmemory: embedding model cached'))" + ENV AGENTMEMORY_III_VERSION=${III_VERSION} \ TINI_SUBREAPER=1