# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image as the base
FROM node:22.12-alpine AS builder
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the container
COPY package.json package-lock.json ./
# Install dependencies
RUN --mount=type=cache,target=/root/.npm npm install
# Copy the rest of the application code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Use a lightweight Node.js image for the final build
FROM node:22-alpine
# Set the working directory inside the container
WORKDIR /app
# Copy the build output and node_modules from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
# Set environment variables
ENV NEO4J_URI=bolt://localhost:7687
ENV NEO4J_USERNAME=neo4j
# NEO4J_PASSWORD should be set at runtime
# Specify the command to run the application
ENTRYPOINT ["node", "build/index.js"]