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