# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Node.js 18 image as the base image
FROM node:18-slim AS build
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install the project dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Create a new stage for the production image
FROM node:18-slim
# Set the working directory in the container
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/build /app/build
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/package-lock.json /app/package-lock.json
# Install only production dependencies
RUN npm ci --omit=dev
# Set environment variable for the reports directory
ENV MAIGRET_REPORTS_DIR=/app/reports
# Create the reports directory
RUN mkdir -p $MAIGRET_REPORTS_DIR
# Expose the port on which the application will run
EXPOSE 3000
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]