-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 963 Bytes
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 963 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
39
40
41
42
43
44
# Build stage
FROM node:18-alpine AS builder
# Install pnpm
RUN corepack enable && corepack prepare [email protected] --activate
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY mcp-server/package.json ./mcp-server/
COPY sdk/package.json ./sdk/
COPY examples/package.json ./examples/
# Install dependencies
RUN pnpm install
# Copy source files
COPY . .
# Build the project
RUN pnpm --filter mcp-server build
# Production stage
FROM node:18-alpine AS runner
WORKDIR /app
# Copy built artifacts and necessary files
COPY --from=builder /app/mcp-server/dist ./dist
COPY --from=builder /app/mcp-server/package.json ./
COPY --from=builder /app/pnpm-lock.yaml ./
# Install production dependencies only
RUN corepack enable && \
corepack prepare [email protected] --activate && \
pnpm install --prod
# Expose the port the app runs on
EXPOSE 3000
# Start the server
CMD ["node", "dist/index.js"]