# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Stage 1: Build the TypeScript project
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install --ignore-scripts
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Stage 2: Create the final image for running the app
FROM node:18-alpine
# Set the working directory
WORKDIR /app
# Copy built files from the builder stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package-lock.json /app
# Install only production dependencies
RUN npm ci --omit=dev
# Set the command to run the app
CMD ["node", "dist/index.js"]