File size: 802 Bytes
e4e271d
4375bad
 
fb1efd1
4375bad
 
e4e271d
4375bad
fb1efd1
 
4375bad
 
e4e271d
4375bad
fb1efd1
e4e271d
4375bad
 
e4e271d
4375bad
 
e4e271d
fb1efd1
ab4296d
e4e271d
fb1efd1
4375bad
e4e271d
 
 
 
 
 
 
 
 
 
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
36
37
38
# Use a small Node.js base image
FROM node:18-alpine

# Set working directory
WORKDIR /app

# Copy package files first for caching
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy all files
COPY . .

# Build the app (this generates 'build' or 'dist' folder)
RUN npm run build

# Install a lightweight static file server
RUN npm install -g serve

# Default port (Hugging Face will override this)
ENV PORT=7860

# Expose the port
EXPOSE 7860

# === IMPORTANT ===
# For React (CRA): folder is 'build'
# For Vite / Vue / Svelte: folder is 'dist'
# Uncomment the correct line below:

# For React (create-react-app):
# CMD ["sh", "-c", "serve -s build -l tcp://0.0.0.0:${PORT}"]

# For Vite / Vue / Svelte (most modern setups):
CMD ["sh", "-c", "serve -s dist -l tcp://0.0.0.0:${PORT}"]