multimodalart HF Staff commited on
Commit
e666fa8
·
verified ·
1 Parent(s): 1e3df6d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-slim
2
+
3
+ # Set up a new user named "user" with user ID 1000
4
+ RUN useradd -m -u 1000 user
5
+
6
+ # Switch to the "user" user
7
+ USER user
8
+
9
+ # Set home to the user's home directory
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+
13
+ # Set the working directory to the user's home directory
14
+ WORKDIR $HOME/app
15
+
16
+ # Copy package files with proper ownership
17
+ COPY --chown=user package*.json ./
18
+
19
+ # Install dependencies
20
+ RUN npm install
21
+
22
+ # Copy application files with proper ownership
23
+ COPY --chown=user proxy.js ./
24
+ COPY --chown=user README.md ./
25
+
26
+ # Expose port 7860 (HF Spaces default)
27
+ EXPOSE 7860
28
+
29
+ # Start the application
30
+ CMD ["node", "proxy.js"]