# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js base image
FROM node:20-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy the package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install the dependencies
RUN npm install
# Copy the source code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Use a smaller node image for the final build
FROM node:20-alpine AS release
# Set the working directory
WORKDIR /app
# Copy the build artifacts and node_modules from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
# Specify the command to run the server
CMD ["node", "build/index.js"]