multimodalart HF Staff commited on
Commit
93d5654
·
verified ·
1 Parent(s): 2a64b09

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -12
Dockerfile CHANGED
@@ -1,27 +1,25 @@
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
 
1
  FROM node:18-slim
2
 
3
+ # The node:18-slim image already has a user with UID 1000 (node)
4
+ # We'll use that user instead of creating a new one
5
+ USER node
6
 
7
+ # Set home to the node user's home directory
8
+ ENV HOME=/home/node \
9
+ PATH=/home/node/.local/bin:$PATH
10
 
11
+ # Set the working directory
 
 
 
 
12
  WORKDIR $HOME/app
13
 
14
  # Copy package files with proper ownership
15
+ COPY --chown=node package*.json ./
16
 
17
  # Install dependencies
18
  RUN npm install
19
 
20
  # Copy application files with proper ownership
21
+ COPY --chown=node proxy.js ./
22
+ COPY --chown=node README.md ./
23
 
24
  # Expose port 7860 (HF Spaces default)
25
  EXPOSE 7860