wuhp commited on
Commit
b90ef8e
·
verified ·
1 Parent(s): c7bfb1a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -2,25 +2,25 @@
2
  FROM node:22-alpine
3
 
4
  # Hugging Face Spaces require running as a non-root user (UID 1000)
5
- RUN adduser -D -u 1000 appuser
6
 
7
  # Set the working directory
8
  WORKDIR /app
9
 
10
  # Give the non-root user ownership of the working directory
11
- RUN chown -R appuser:appuser /app
12
 
13
  # Switch to the non-root user
14
- USER appuser
15
 
16
  # Copy package.json and permissions
17
- COPY --chown=appuser:appuser package*.json ./
18
 
19
  # Install dependencies
20
  RUN npm install
21
 
22
  # Copy the rest of the application code
23
- COPY --chown=appuser:appuser . .
24
 
25
  # Build the frontend and backend
26
  RUN npm run build
 
2
  FROM node:22-alpine
3
 
4
  # Hugging Face Spaces require running as a non-root user (UID 1000)
5
+ # The official 'node' image already provides a user named 'node' with UID 1000
6
 
7
  # Set the working directory
8
  WORKDIR /app
9
 
10
  # Give the non-root user ownership of the working directory
11
+ RUN chown -R node:node /app
12
 
13
  # Switch to the non-root user
14
+ USER node
15
 
16
  # Copy package.json and permissions
17
+ COPY --chown=node:node package*.json ./
18
 
19
  # Install dependencies
20
  RUN npm install
21
 
22
  # Copy the rest of the application code
23
+ COPY --chown=node:node . .
24
 
25
  # Build the frontend and backend
26
  RUN npm run build