Pham Huy commited on
Commit
43a6316
·
1 Parent(s): daa9485

update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -10
Dockerfile CHANGED
@@ -1,23 +1,21 @@
1
  FROM ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleocr-genai-vllm-server:latest-offline
2
 
3
- # Switch to root to have permissions for user creation and directory setup
4
  USER root
5
 
6
- # Check what user already has UID 1000 (Required by HF Spaces)
7
- RUN getent passwd 1000 || echo "No user with UID 1000 found"
8
-
9
- ENV USER=user \
10
- HOME=/home/user \
11
- PATH="/home/user/.local/bin:$PATH" \
12
  PYTHONUNBUFFERED=1
13
 
14
  WORKDIR /app
15
 
16
- # Ensure the new user owns the application directory
17
- RUN chown user:user /app
18
 
19
  # Switch to the non-root user for runtime security
20
- USER user
21
 
22
  EXPOSE 7860
23
 
 
1
  FROM ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddleocr-genai-vllm-server:latest-offline
2
 
3
+ # Switch to root to have permissions for directory setup
4
  USER root
5
 
6
+ # Use existing user 'paddleocr' with UID 1000 (Required by HF Spaces)
7
+ ENV USER=paddleocr \
8
+ HOME=/home/paddleocr \
9
+ PATH="/home/paddleocr/.local/bin:$PATH" \
 
 
10
  PYTHONUNBUFFERED=1
11
 
12
  WORKDIR /app
13
 
14
+ # Ensure the paddleocr user owns the application directory
15
+ RUN chown paddleocr:paddleocr /app
16
 
17
  # Switch to the non-root user for runtime security
18
+ USER paddleocr
19
 
20
  EXPOSE 7860
21