# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Node.js image as the base image
FROM node:22.12-alpine AS builder
# Create and set the 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 --mount=type=cache,target=/root/.npm npm install
# Copy the entire project to the working directory
COPY . .
# Build the project
RUN npm run build
# Use a minimal Node.js image to run the application
FROM node:22-alpine AS release
# Set the working directory
WORKDIR /app
# Copy the built files from the builder stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package-lock.json
# Set environment variables (replace these with actual values or secrets)
ENV AZURE_TENANT_ID=<YOUR_TENANT_ID>
ENV AZURE_CLIENT_ID=<YOUR_CLIENT_ID>
ENV AZURE_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
# Install only production dependencies
RUN npm ci --omit=dev
# Command to run the application
ENTRYPOINT ["node", "dist/index.js"]