# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image for building the application
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application files
COPY . .
# Build the TypeScript files
RUN npm run build
# Use a lighter image to run the application
FROM node:18-alpine AS runner
# Set the working directory
WORKDIR /app
# Copy the build output and node_modules from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/node_modules /app/node_modules
# Set environment variables (the API key should be set as an environment variable at runtime)
ENV NODE_ENV=production
# Define the command to run the application
ENTRYPOINT ["node", "build/index.js"]