Skip to content

Commit c4ce225

Browse files
authored
fix: update MCP Dockerfile to use pnpm monorepo setup and update schema version (#1252)
1 parent 4eb491a commit c4ce225

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

.github/workflows/ecr-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
id: build-push
3535
uses: docker/build-push-action@v6
3636
with:
37-
context: packages/mcp
37+
context: .
3838
file: packages/mcp/Dockerfile
3939
platforms: linux/amd64
4040
push: true

packages/mcp/Dockerfile

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
21
# ----- Build Stage -----
32
FROM node:lts-alpine AS builder
3+
RUN corepack enable pnpm
44
WORKDIR /app
55

6-
# Copy package and configuration
7-
COPY package.json bun.lock tsconfig.json ./
6+
# Copy monorepo config and install dependencies
7+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./
8+
COPY packages/mcp ./packages/mcp
9+
RUN pnpm install --frozen-lockfile
810

9-
# Copy source code
10-
COPY src ./src
11-
12-
# Install dependencies and build
13-
RUN npm install && npm run build
11+
# Build the mcp package
12+
RUN pnpm --filter @upstash/context7-mcp build
1413

1514
# ----- Production Stage -----
1615
FROM node:lts-alpine
16+
RUN corepack enable pnpm
1717
WORKDIR /app
1818

19-
# Copy built artifacts
20-
COPY --from=builder /app/dist ./dist
21-
22-
# Copy package.json for production install
23-
COPY package.json ./
19+
# Install production dependencies only
20+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
21+
COPY packages/mcp/package.json ./packages/mcp/
22+
RUN pnpm install --frozen-lockfile --prod --filter @upstash/context7-mcp
2423

25-
# Install only production dependencies
26-
RUN npm install --production --ignore-scripts
24+
# Copy built files from builder
25+
COPY --from=builder /app/packages/mcp/dist ./packages/mcp/dist
2726

28-
# Expose HTTP port
27+
WORKDIR /app/packages/mcp
2928
EXPOSE 8080
30-
31-
# Default command using CLI flags
3229
CMD ["node", "dist/index.js", "--transport", "http", "--port", "8080"]

server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "io.github.upstash/context7",
44
"title": "Context7",
55
"description": "Up-to-date code docs for any prompt",

0 commit comments

Comments
 (0)