File size: 579 Bytes
98db231
 
 
 
3178b5a
98db231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use Node.js base image instead of Python
FROM node:18-bullseye

# Create non-root user (to follow HF convention)
RUN useradd -m -u 1570 user
USER user

# Set work directory
WORKDIR /app

# Copy package files first (for caching installs)
COPY --chown=user package*.json ./

# Install dependencies
RUN npm install --legacy-peer-deps

# Copy all source code
COPY --chown=user . .

# Build Next.js app
RUN npm run build

# Expose port 7860 (Hugging Face requirement)
EXPOSE 7860

# Run Next.js in production mode, bound to port 7860
CMD ["npm", "run", "start", "--", "-p", "7860"]