Update Dockerfile
Browse files- 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 |
-
#
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
# Change the ownership of the app directory
|
| 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
|