# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image with an appropriate version
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json* ./
RUN npm install
# Copy the rest of the application source code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Use a smaller node image to run the built application
FROM node:20-slim
# Set working directory
WORKDIR /app
# Copy built files and node_modules from the builder stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/node_modules /app/node_modules
# Environment variables and default command
ENV MEMORY_BANK_ROOT="/path/to/memory-bank"
CMD ["node", "dist/index.js"]