Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +8 -3
Dockerfile
CHANGED
@@ -8,9 +8,9 @@ RUN apt-get update && apt-get install -y \
|
|
8 |
git \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
# Create
|
12 |
-
RUN mkdir -p /tmp
|
13 |
-
chmod -R 777 /tmp
|
14 |
|
15 |
# Copy requirements and install dependencies
|
16 |
COPY requirements.txt .
|
@@ -19,6 +19,11 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
19 |
# Copy application code
|
20 |
COPY app.py .
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
# Expose the port
|
23 |
EXPOSE 7860
|
24 |
|
|
|
8 |
git \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
+
# Create writable cache directories
|
12 |
+
RUN mkdir -p /tmp/transformers_cache /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
|
13 |
+
chmod -R 777 /tmp
|
14 |
|
15 |
# Copy requirements and install dependencies
|
16 |
COPY requirements.txt .
|
|
|
19 |
# Copy application code
|
20 |
COPY app.py .
|
21 |
|
22 |
+
# Set environment variables
|
23 |
+
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
|
24 |
+
ENV HF_HOME=/tmp/hf_home
|
25 |
+
ENV XDG_CACHE_HOME=/tmp/cache
|
26 |
+
|
27 |
# Expose the port
|
28 |
EXPOSE 7860
|
29 |
|