# Build stage FROM node:22-slim AS build WORKDIR /app RUN corepack enable && npm install -g bun@1.3.3 COPY package.json bun.lock ./ RUN bun install --frozen-lockfile COPY . . # Build with the Node server preset so the output runs in a plain Docker container ENV NITRO_PRESET=node-server RUN bun run build # Runtime stage FROM node:22-slim AS runtime WORKDIR /app ENV NODE_ENV=production \ PORT=7860 \ HOST=0.0.0.0 # Install Python 3, building dependencies and required libraries for GGUF model support RUN apt-get update && apt-get install -y python3 python3-pip python3-dev build-essential && rm -rf /var/lib/apt/lists/* RUN pip3 install --break-system-packages huggingface_hub llama-cpp-python numpy COPY --from=build /app/.output ./.output EXPOSE 7860 CMD ["node", ".output/server/index.mjs"]