# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Node.js 20 image as the base
FROM node:20-slim AS build
# Set the working directory
WORKDIR /app
# Copy files to the working directory
COPY . ./
# Install dependencies and build the project
RUN npm install -g pnpm && pnpm install --frozen-lockfile && pnpm run build
# Use a smaller Node.js base image for the final stage
FROM node:20-slim AS release
# Set the working directory
WORKDIR /app
# Copy the build output and necessary files from the build stage
COPY --from=build /app/dist /app/dist
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/package.json /app/package.json
# Set environment variables if necessary
ENV NODE_ENV=production
# Command to run the application
ENTRYPOINT ["node", "dist/index.js"]