File size: 727 Bytes
60faa09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
# HuggingFace Space Dockerfile for Hugging-c-ai
# Builds the Next.js 16 app and serves it on port 7860.

FROM node:20-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    git openssl curl ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY package*.json ./
COPY prisma.config.ts ./
COPY prisma ./prisma

RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund

COPY . .

ENV DATABASE_URL="file:./dev.db"
RUN npx prisma generate
RUN npx prisma db push --accept-data-loss

RUN npm run build

ENV PORT=7860
ENV HOSTNAME=0.0.0.0
EXPOSE 7860

RUN useradd -m -u 1000 user
RUN chown -R user:user /app
USER user

CMD ["npm", "run", "start", "--", "-p", "7860", "-H", "0.0.0.0"]