-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 928 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (23 loc) · 928 Bytes
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
# ── Stage 1: Build ──────────────────────────────────────────────────
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
# ── Stage 2: Production ────────────────────────────────────────────
FROM node:20-alpine
WORKDIR /app
# Install production dependencies only
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev && npm cache clean --force
# Copy compiled output
COPY --from=builder /app/dist ./dist
# Azure App Service expects port 8080 by default
ENV PORT=8080
EXPOSE 8080
# Non-root user for security
RUN addgroup -S mcpgroup && adduser -S mcpuser -G mcpgroup
USER mcpuser
CMD ["node", "dist/server.js"]