# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image for building the application
FROM node:20-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm install
# Copy the source code and build the application
COPY src ./src
COPY tsconfig.json ./
RUN npm run build
# Use a lighter Node.js image for running the application
FROM node:20-alpine AS release
# Set the working directory
WORKDIR /app
# Copy the built application and node_modules from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
# Set environment variables
ENV NODE_ENV=production
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]