# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use an official Node.js runtime as a parent image
FROM node:18-alpine AS build
# Set the working directory in the container
WORKDIR /app
# Copy the package files and install the dependencies
COPY package.json package-lock.json ./
RUN npm install --ignore-scripts
# Copy the rest of the application
COPY . .
# Build the TypeScript code
RUN npm run build
# Use a lighter image for the runtime
FROM node:18-alpine AS runtime
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/dist ./dist
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/package-lock.json ./package-lock.json
# Install only production dependencies
RUN npm ci --omit=dev
# Command to run the application
ENTRYPOINT ["node", "dist/index.js"]