Docker: fail the build if the search model can't be fetched

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
dlawler489 2026-09-15 12:51:55 +10:00
parent 0f49fe8c1a
commit 2796fab38c

View file

@ -28,7 +28,8 @@ COPY . .
# The embedding model for semantic search (~34 MB), fetched at build time so the
# server never has to download it.
ENV MODELS_DIR=/app/models
RUN node -e "require('./lib/embeddingModel').load().then(() => console.log('embedding model ready'))"
# (No process.exit: forcing an exit while onnxruntime's threads are up aborts node.)
RUN node -e "require('./lib/embeddingModel').embed(['test']).then(() => console.log('embedding model ready'), (err) => { console.error(err); process.exitCode = 1; })"
ENV NODE_ENV=production \
PORT=3000