-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 1.32 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (33 loc) · 1.32 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
37
38
39
40
41
42
43
# Build stage
#
# Pin the builder to the native build platform ($BUILDPLATFORM) so the build
# never runs under QEMU emulation. esbuild (invoked by `vite build`) spawns a
# native helper process that crashes under QEMU with "The service was stopped".
# The build output (dist/) and all production deps are pure JS, so artifacts are
# platform-independent and safe to use in the target-platform runtime stage.
FROM --platform=$BUILDPLATFORM node:24-alpine AS builder
WORKDIR /app
# Enable the repo-pinned pnpm version via packageManager in package.json.
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
RUN pnpm prune --prod
# Runtime stage
FROM node:24-alpine
WORKDIR /app
RUN apk add --no-cache curl
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/openapi-specs ./openapi-specs
ENV NODE_ENV=production \
MCP_PORT=3000 \
MCP_PATH=/mcp
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=5 \
CMD curl -sf http://127.0.0.1:3000/health >/dev/null || exit 1
# Use V2 architecture (stateless, HTTP-only)
CMD ["node", "--enable-source-maps", "dist/v2/index.js"]