# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image
FROM node:18-alpine AS builder
# Set 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 source code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Use a smaller Node.js image for the runtime
FROM node:18-alpine AS runtime
# Set working directory
WORKDIR /app
# Copy the build output and package files from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json
# Install only production dependencies
RUN npm install --ignore-scripts --omit=dev
# Set the entry point
ENTRYPOINT ["node", "build/index.js"]