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