# Generated by Antigravity
# V1: Node 22 Base, Multi-stage build
# -- Builder Stage --
FROM node:22-slim AS builder
WORKDIR /app
# Enable corepack for pnpm support if needed, or just install it
RUN npm install -g pnpm
# Copy manifests first for caching
COPY package.json pnpm-lock.yaml* ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source code and config
COPY . .
# Build the project
RUN pnpm run build
# -- Production Stage --
FROM node:22-slim AS runner
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy package.json to run scripts (like 'start')
COPY package.json ./
# Install only production dependencies
RUN pnpm install --prod --frozen-lockfile
# Copy built artifacts from builder
COPY --from=builder /app/dist ./dist
# Expose port if needed (MCP usually runs over stdio, but some use SSE/HTTP.
# Zhook MCP seems to use StdioServerTransport in index.ts, so no EXPOSE strictly needed for stdio,
# but mcp-proxy might need it?
# Glama's error log showed: CMD ["mcp-proxy","node","dist/index.js"]
# So we run npm install -g mcp-proxy and use it in CMD.
RUN npm install -g mcp-proxy@6.2.0
CMD ["mcp-proxy", "node", "dist/index.js"]