Emalawi19 commited on
Commit
7a7f4c5
·
verified ·
1 Parent(s): 123428d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,20 +1,20 @@
1
  # Use an official Node.js image
2
  FROM node:20-slim
3
 
4
- # Set up a new user to avoid Hugging Face permission issues
5
- RUN useradd -m -u 1000 user
6
- USER user
7
- ENV HOME=/home/user
8
  WORKDIR $HOME/app
9
 
10
- # Copy configuration files
11
- COPY --chown=user package*.json ./
12
 
13
  # Install dependencies
14
  RUN npm install
15
 
16
  # Copy the rest of the application files
17
- COPY --chown=user . .
18
 
19
  # Expose the default port for the API gateway
20
  EXPOSE 7860
 
1
  # Use an official Node.js image
2
  FROM node:20-slim
3
 
4
+ # The image already has a 'node' user with UID 1000.
5
+ # Hugging Face requires UID 1000, so we switch to this existing user.
6
+ USER node
7
+ ENV HOME=/home/node
8
  WORKDIR $HOME/app
9
 
10
+ # Copy configuration files with the correct ownership
11
+ COPY --chown=node package*.json ./
12
 
13
  # Install dependencies
14
  RUN npm install
15
 
16
  # Copy the rest of the application files
17
+ COPY --chown=node . .
18
 
19
  # Expose the default port for the API gateway
20
  EXPOSE 7860