# Build stage FROM node:18-alpine AS builder WORKDIR /app # Copy package files COPY package*.json ./ # Install dependencies RUN npm ci # Copy source code COPY . . # Build the project RUN npm run build # Production stage FROM node:18-alpine WORKDIR /app # Copy package files COPY package*.json ./ # Install production dependencies only RUN npm ci --only=production # Copy built files from builder stage COPY --from=builder /app/dist ./dist # Create a non-root user RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001 # Change ownership RUN chown -R nodejs:nodejs /app # Switch to non-root user USER nodejs # Expose the MCP server port (if using HTTP transport) EXPOSE 3000 # Start the MCP server CMD ["node", "dist/index.js"]