File size: 481 Bytes
46c44ad
 
 
 
 
 
 
 
 
0a27f4a
46c44ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:20-slim

# Create app directory
WORKDIR /app

# Copy package.json
COPY package*.json ./

# Install app dependencies
RUN npm install --omit=dev

# Bundle app source
COPY . .

# Expose the port Hugging Face expects
EXPOSE 7860

# Set environment variables
ENV PORT=7860
ENV NODE_ENV=production

# Hugging Face runs with user ID 1000. Let's make sure our user has ownership of the files.
RUN chown -R 1000:0 /app && chmod -R g+w /app

USER 1000

CMD [ "node", "server.js" ]