# 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 to the working directory
COPY package.json package-lock.json ./
# Install project dependencies
RUN npm install
# Copy the entire project directory
COPY . .
# Build the project
RUN npm run build
# Start a new stage for the final image
FROM node:18-alpine AS release
# Set working directory
WORKDIR /app
# Copy package files
COPY --from=builder /app/package.json /app/package-lock.json ./
# Install production dependencies
RUN npm ci --omit=dev
# Copy the build files from the previous stage
COPY --from=builder /app/dist ./dist
# Expose the port the server runs on
EXPOSE 8080
# Set the entry point to run the server
ENTRYPOINT ["node", "dist/index.js"]