File size: 757 Bytes
47a00d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile
# Use an official Node.js runtime as the base image
FROM node:22.1.0

WORKDIR /usr/src/app

# Copy only package files first for better layer caching
# Use 1000:1000 for non-root user/group typically used in these images
COPY --chown=1000:1000 package.json package-lock.json ./

# Install production dependencies only
RUN npm install --production --ignore-scripts

# Copy the rest of the application files
# This includes app.js, public/index.html, data/users.json (initially empty if not existing)
COPY --chown=1000:1000 . .

# Expose the port Hugging Face expects (usually 7860)
EXPOSE 7860

# Ensure the app runs as non-root user (good practice)
USER 1000

# Start the application using the start script from package.json
CMD ["npm", "start"]