rkihacker commited on
Commit
2f7dd30
·
verified ·
1 Parent(s): eb586a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -3
Dockerfile CHANGED
@@ -14,12 +14,14 @@ RUN pip install --no-cache-dir -r requirements.txt
14
  COPY main.py .
15
 
16
  # Create the directory for uploads
 
17
  RUN mkdir uploads
18
 
19
- # Create a non-root user and group for security
20
- RUN addgroup -S appgroup && adduser -S appuser -G appgroup
 
21
 
22
- # Change the ownership of the app directory and its contents to the new user
23
  RUN chown -R appuser:appgroup /app
24
 
25
  # Switch to the non-root user
 
14
  COPY main.py .
15
 
16
  # Create the directory for uploads
17
+ # This command runs as root, so it has permission
18
  RUN mkdir uploads
19
 
20
+ # --- FIX: Use Debian-compatible commands to create a non-root user ---
21
+ # Create a system group and user for security best practices
22
+ RUN addgroup --system appgroup && adduser --system --ingroup appgroup --no-create-home appuser
23
 
24
+ # Change the ownership of the app directory to the new user
25
  RUN chown -R appuser:appgroup /app
26
 
27
  # Switch to the non-root user