# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image
FROM node:16-alpine AS builder
# Create and change to the app directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the source code
COPY src/ ./src
# Build the project
RUN npm run build
# Use a smaller Node.js image for the runtime
FROM node:16-alpine
# Set working directory
WORKDIR /app
# Copy the built files and package files from the builder
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package-lock.json ./
# Install only production dependencies
RUN npm ci --only=production
# Start the server
ENTRYPOINT ["node", "dist/index.js"]