File size: 655 Bytes
4ce3e23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:20-slim

# HF Spaces runs containers as a non-root user (uid 1000). Create it so the
# app's data/ dir under WORKDIR stays writable at runtime.
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR /home/user/app

# Install deps (incl. dev — needed for `next build` and tailwind/typescript).
COPY --chown=user package.json package-lock.json ./
RUN npm install --include=dev

# App source.
COPY --chown=user . .

# Build Next.js.
RUN npm run build

ENV NODE_ENV=production \
    PORT=7860

EXPOSE 7860

# Custom server merges Next + WebSocket on the single exposed port.
CMD ["npm", "start"]