-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (39 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
56 lines (39 loc) · 1.14 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
44
45
46
47
48
49
50
51
52
53
54
55
56
# Multi-stage build for production optimization
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install all dependencies (including dev dependencies for build)
RUN npm ci
# Copy source code
COPY src ./src
COPY prompts ./prompts
# Build TypeScript
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production
# Copy built files from builder
COPY --from=builder /app/dist ./dist
COPY prompts ./prompts
# Make the binary executable
RUN chmod +x /app/dist/index.js
# Create a non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
# Set ownership
RUN chown -R nodejs:nodejs /app
USER nodejs
# MCP uses stdio, not HTTP
# Port exposure is for documentation/health checks if needed
EXPOSE 3000
# Health check (optional - checks if node process is running)
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "process.exit(0)" || exit 1
# Run the MCP server
ENTRYPOINT ["node", "/app/dist/index.js"]