File size: 619 Bytes
9a831cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use Node 18 Alpine
FROM node:18-alpine

# 1. Create the user 'user' with ID 1000 (Required by Hugging Face)
RUN adduser -D -u 1000 user

# 2. Switch to that user and set the home directory
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# 3. Set the working directory
WORKDIR $HOME/app

# 4. Copy package.json with correct permissions
COPY --chown=user package*.json ./

# 5. Install dependencies
RUN npm install

# 6. Copy the rest of the application code
COPY --chown=user . .

# 7. EXPOSE PORT 7860 (Strictly required by Hugging Face)
EXPOSE 7860

# 8. Start the app
CMD ["node", "index.js"]