# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Stage 1: Build
FROM node:lts-alpine AS builder
WORKDIR /app

# Install dependencies and build
COPY package.json pnpm-lock.yaml tsconfig.json ./
COPY src ./src
RUN npm install
RUN npm run build

# Stage 2: Runtime
FROM node:lts-alpine AS runtime
WORKDIR /app

# Copy built files and package.json to install production dependencies
COPY --from=builder /app/build ./build
COPY package.json ./

# Install only production dependencies
RUN npm install --production

ENV NODE_ENV=production
ENTRYPOINT ["node", "build/index.js"]
