Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +8 -8
Dockerfile
CHANGED
@@ -9,22 +9,22 @@ WORKDIR /app
|
|
9 |
# Copy the application files
|
10 |
COPY . .
|
11 |
|
12 |
-
#
|
13 |
-
RUN chown -R appuser:appgroup /app
|
14 |
|
15 |
-
# Set environment variable to point to
|
16 |
ENV HF_HOME=/app/.cache/huggingface
|
17 |
|
18 |
-
# Switch to the non-root user
|
19 |
USER root
|
20 |
|
21 |
# Install Python dependencies
|
22 |
-
RUN
|
23 |
|
24 |
-
#
|
25 |
-
|
26 |
|
27 |
-
|
|
|
28 |
|
29 |
# Expose the port that the application listens on
|
30 |
EXPOSE 8000
|
|
|
9 |
# Copy the application files
|
10 |
COPY . .
|
11 |
|
12 |
+
# Create the .cache directory inside /app and set permissions
|
13 |
+
RUN mkdir -p /app/.cache/huggingface && chown -R appuser:appgroup /app/.cache
|
14 |
|
15 |
+
# Set environment variable to point to the cache directory
|
16 |
ENV HF_HOME=/app/.cache/huggingface
|
17 |
|
|
|
18 |
USER root
|
19 |
|
20 |
# Install Python dependencies
|
21 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
+
# Set the ownership of the entire /app directory
|
24 |
+
RUN chown -R appuser:appgroup /app
|
25 |
|
26 |
+
# Switch to the non-root user
|
27 |
+
USER appuser
|
28 |
|
29 |
# Expose the port that the application listens on
|
30 |
EXPOSE 8000
|