Update Dockerfile
Browse files- Dockerfile +1 -6
Dockerfile
CHANGED
|
@@ -13,15 +13,10 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 13 |
# Copy the content of the local src directory to the working directory
|
| 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
|
|
|
|
| 13 |
# Copy the content of the local src directory to the working directory
|
| 14 |
COPY main.py .
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# Create a system group and user for security best practices
|
| 17 |
RUN addgroup --system appgroup && adduser --system --ingroup appgroup --no-create-home appuser
|
| 18 |
|
| 19 |
+
# Change the ownership of the app directory to the new user for good practice
|
| 20 |
RUN chown -R appuser:appgroup /app
|
| 21 |
|
| 22 |
# Switch to the non-root user
|