-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 806 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (26 loc) · 806 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
35
36
37
38
# ---- Build Stage ----
FROM node:20-alpine AS builder
WORKDIR /app
# Copy dependency files first for layer caching
COPY package*.json ./
# Install all dependencies (--ignore-scripts prevents the "prepare" hook
# from running before source files are available)
RUN npm ci --ignore-scripts
# Copy source and config
COPY tsconfig.json ./
COPY src/ ./src/
# Now build explicitly
RUN npx tsc && npx shx chmod +x dist/*.js
# ---- Production Stage ----
FROM node:20-alpine AS production
WORKDIR /app
# Copy dependency files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --omit=dev --ignore-scripts
# Copy compiled output from builder
COPY --from=builder /app/dist ./dist
# Expose the MCP server port (default 8007)
EXPOSE 8007
# Run the server
CMD ["node", "dist/index.js"]