File size: 715 Bytes
283b6c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e94f914
 
 
 
 
283b6c6
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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 and huggingface_hub library
RUN apt-get update && apt-get install -y python3 python3-pip && rm -rf /var/lib/apt/lists/*
RUN pip3 install --break-system-packages huggingface_hub

COPY --from=build /app/.output ./.output
EXPOSE 7860
CMD ["node", ".output/server/index.mjs"]