Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
@@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y \
|
|
16 |
|
17 |
# Create a non-root user and set it as the user for the rest of the image
|
18 |
RUN useradd -ms /bin/bash appuser
|
|
|
|
|
|
|
|
|
|
|
19 |
USER appuser
|
20 |
|
21 |
# Create necessary directories and set permissions
|
@@ -26,7 +31,7 @@ RUN mkdir -p /app/uploads /home/appuser/.dotnet && \
|
|
26 |
ENV DOTNET_HOME="/home/appuser/.dotnet"
|
27 |
ENV PATH="${PATH}:${DOTNET_HOME}"
|
28 |
|
29 |
-
# Copy the requirements file with the
|
30 |
COPY --chown=appuser:appuser ./requirements.txt /app/requirements.txt
|
31 |
|
32 |
# Install Python dependencies
|
|
|
16 |
|
17 |
# Create a non-root user and set it as the user for the rest of the image
|
18 |
RUN useradd -ms /bin/bash appuser
|
19 |
+
|
20 |
+
# Ensure the /app directory is owned by the non-root user
|
21 |
+
RUN chown -R appuser:appuser /app
|
22 |
+
|
23 |
+
# Switch to the non-root user
|
24 |
USER appuser
|
25 |
|
26 |
# Create necessary directories and set permissions
|
|
|
31 |
ENV DOTNET_HOME="/home/appuser/.dotnet"
|
32 |
ENV PATH="${PATH}:${DOTNET_HOME}"
|
33 |
|
34 |
+
# Copy the requirements file with the correct owner
|
35 |
COPY --chown=appuser:appuser ./requirements.txt /app/requirements.txt
|
36 |
|
37 |
# Install Python dependencies
|