-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (22 loc) · 898 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (22 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# syntax=docker/dockerfile:1
FROM node:22.22.0-alpine AS build
ENV CI=true
WORKDIR /workspace
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig*.json biome.json vitest.config.ts ./
COPY packages ./packages
RUN pnpm install --frozen-lockfile \
&& pnpm build \
&& pnpm --filter @model-runtime/server deploy --prod --legacy /out
FROM node:22.22.0-alpine AS runtime
ENV NODE_ENV=production \
MODEL_RUNTIME_HOST=127.0.0.1 \
MODEL_RUNTIME_PORT=4320
WORKDIR /app
RUN addgroup -S runtime && adduser -S runtime -G runtime
COPY --from=build --chown=runtime:runtime /out ./
USER runtime
EXPOSE 4320
HEALTHCHECK --interval=10s --timeout=2s --start-period=5s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:4320/v1/runtime').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
CMD ["node", "dist/cli.js"]