# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image as the base image
FROM node:16-alpine AS build
# Set the working directory inside the Docker container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install project dependencies
RUN npm install
# Copy the rest of the project files to the working directory
COPY . .
# Build the project
RUN npm run build
# Use a smaller Node.js image for the final output
FROM node:16-alpine AS production
# Set the working directory
WORKDIR /app
# Copy the build files from the build stage
COPY --from=build /app/build ./build
# Copy only necessary files
COPY package.json ./
# Install only production dependencies
RUN npm install --production
# Set environment variables
ENV NODE_ENV=production
# Command to run the application
CMD ["node", "build/index.js"]