11# Build stage
2- FROM node:20-alpine AS builder
2+ FROM node:20-alpine AS builder
33
44# Enable corepack to use pnpm
55RUN corepack enable && corepack prepare pnpm@latest --activate
66
7- # Install bash for build script
8- RUN apk add --no-cache bash openssl
7+ # Install bash for build script
8+ RUN apk add --no-cache bash openssl
99
10- # Set working directory
11- WORKDIR /build
10+ # Set working directory
11+ WORKDIR /build
1212
13- # Copy entire repository
14- COPY . .
13+ # Copy entire repository
14+ COPY . .
1515
16- # Install all dependencies and build everything
17- RUN pnpm install --frozen-lockfile && \
18- pnpm build
16+ # Install all dependencies and build everything
17+ RUN pnpm install --frozen-lockfile && \
18+ pnpm build
1919
20- # Production stage
20+ # Production stage
2121
22- FROM denoland/deno:alpine
23- RUN apk add --no-cache npm
22+ FROM denoland/deno:alpine
23+ RUN apk add --no-cache npm
2424
25- # Add non-root user
26- RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
25+ # Add non-root user
26+ RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
2727
28- # Set working directory
29- WORKDIR /app
28+ # Set working directory
29+ WORKDIR /app
3030
3131# Copy the built mcp-server preserving directory structure
3232COPY --from=builder /build/packages/mcp-server/dist ./packages/mcp-server/dist
@@ -35,24 +35,24 @@ COPY --from=builder /build/packages/mcp-server/node_modules ./packages/mcp-serve
3535# Copy node_modules from root (pnpm hoists dependencies here)
3636COPY --from=builder /build/node_modules ./node_modules
3737
38- # Copy the built @stainless-api/sdk into node_modules
39- COPY --from=builder /build/dist ./node_modules/@stainless-api/sdk
38+ # Copy the built @stainless-api/sdk into node_modules
39+ COPY --from=builder /build/dist ./node_modules/@stainless-api/sdk
4040
41- # Change ownership to nodejs user
42- RUN chown -R nodejs:nodejs /app
41+ # Change ownership to nodejs user
42+ RUN chown -R nodejs:nodejs /app
4343
44- # Switch to non-root user
45- USER nodejs
44+ # Switch to non-root user
45+ USER nodejs
4646
47- # The MCP server uses stdio transport by default
48- # No exposed ports needed for stdio communication
47+ # The MCP server uses stdio transport by default
48+ # No exposed ports needed for stdio communication
4949
5050 # This is needed for node to run on the deno:alpine image.
5151 # See <https://github.com/denoland/deno_docker/issues/373>.
5252 ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
5353
54- # Set the entrypoint to the MCP server
55- ENTRYPOINT ["node" , "packages/mcp-server/dist/index.js" ]
54+ # Set the entrypoint to the MCP server
55+ ENTRYPOINT ["node" , "packages/mcp-server/dist/index.js" ]
5656
57- # Allow passing arguments to the MCP server
58- CMD []
57+ # Allow passing arguments to the MCP server
58+ CMD []
0 commit comments