Lordecyhper commited on
Commit
9a831cb
·
verified ·
1 Parent(s): 57c98b8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Node 18 Alpine
2
+ FROM node:18-alpine
3
+
4
+ # 1. Create the user 'user' with ID 1000 (Required by Hugging Face)
5
+ RUN adduser -D -u 1000 user
6
+
7
+ # 2. Switch to that user and set the home directory
8
+ USER user
9
+ ENV HOME=/home/user \
10
+ PATH=/home/user/.local/bin:$PATH
11
+
12
+ # 3. Set the working directory
13
+ WORKDIR $HOME/app
14
+
15
+ # 4. Copy package.json with correct permissions
16
+ COPY --chown=user package*.json ./
17
+
18
+ # 5. Install dependencies
19
+ RUN npm install
20
+
21
+ # 6. Copy the rest of the application code
22
+ COPY --chown=user . .
23
+
24
+ # 7. EXPOSE PORT 7860 (Strictly required by Hugging Face)
25
+ EXPOSE 7860
26
+
27
+ # 8. Start the app
28
+ CMD ["node", "index.js"]