# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Base image for building TypeScript
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install dependencies without running scripts to avoid prepare script before build
RUN npm install --ignore-scripts
# Copy source files
COPY src/ src/
# Build the TypeScript files
RUN npm run build
# Production image
FROM node:20-alpine AS production
# Set working directory
WORKDIR /app
# Copy built files from builder
COPY --from=builder /app/build/ /app/build/
# Copy package.json and package-lock.json for production installation
COPY package.json package-lock.json ./
# Install only production dependencies
RUN npm ci --omit=dev
# Set environment variables
ENV NODE_ENV=production
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]