Spaces:
Sleeping
Sleeping
EL GHAFRAOUI AYOUB
commited on
Commit
·
5be42b5
1
Parent(s):
8b0f095
- Dockerfile +3 -3
Dockerfile
CHANGED
@@ -4,6 +4,9 @@ FROM python:3.11-slim
|
|
4 |
# Set up a new user named "user" with user ID 1000
|
5 |
RUN useradd -m -u 1000 user
|
6 |
|
|
|
|
|
|
|
7 |
# Switch to the "user" user
|
8 |
USER user
|
9 |
|
@@ -23,9 +26,6 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
23 |
# Copy the application code with correct ownership
|
24 |
COPY --chown=user . .
|
25 |
|
26 |
-
# Create data directory in the persistent storage location
|
27 |
-
RUN mkdir -p /data
|
28 |
-
|
29 |
# Expose port
|
30 |
EXPOSE 8000
|
31 |
|
|
|
4 |
# Set up a new user named "user" with user ID 1000
|
5 |
RUN useradd -m -u 1000 user
|
6 |
|
7 |
+
# Create data directory with proper permissions before switching user
|
8 |
+
RUN mkdir -p /data && chown user:user /data
|
9 |
+
|
10 |
# Switch to the "user" user
|
11 |
USER user
|
12 |
|
|
|
26 |
# Copy the application code with correct ownership
|
27 |
COPY --chown=user . .
|
28 |
|
|
|
|
|
|
|
29 |
# Expose port
|
30 |
EXPOSE 8000
|
31 |
|