-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (25 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM node:20-slim
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY tsconfig.json ./
COPY src/ src/
COPY scripts/ scripts/
COPY migrations/ migrations/
RUN pnpm local:build
# Pre-download the fastembed BGE Base EN v1.5 model into an absolute cache dir
# so the running container does not depend on network access for embeddings.
# FastEmbedProvider is wired to read FASTEMBED_CACHE_DIR at runtime.
ENV FASTEMBED_CACHE_DIR=/app/.fastembed-cache
RUN node scripts/docker/predownload-fastembed.mjs "$FASTEMBED_CACHE_DIR" \
&& chown -R node:node "$FASTEMBED_CACHE_DIR"
RUN mkdir -p /app/memoflare && chown -R node:node /app/memoflare
COPY docker/entrypoint.sh /entrypoint.sh
RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
USER node
EXPOSE 3001
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "fetch('http://localhost:3001/').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
ENTRYPOINT ["/entrypoint.sh"]
CMD ["node", "dist/local.js", "--root", "/app/memoflare"]