-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (22 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
33 lines (22 loc) · 1.02 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
# syntax=docker/dockerfile:1
# ── Build stage ──────────────────────────────────────────────────────────────
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --ignore-scripts
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
# Remove dev dependencies
RUN npm prune --omit=dev
# ── Runtime stage ─────────────────────────────────────────────────────────────
FROM node:22-alpine AS runtime
# Non-root user for security
RUN addgroup -S mcp && adduser -S mcp -G mcp
WORKDIR /app
# Copy only what's needed to run
COPY --from=builder --chown=mcp:mcp /app/dist ./dist
COPY --from=builder --chown=mcp:mcp /app/node_modules ./node_modules
COPY --from=builder --chown=mcp:mcp /app/package.json ./package.json
USER mcp
ENTRYPOINT ["node", "dist/index.js"]