Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -3
Dockerfile
CHANGED
|
@@ -10,12 +10,14 @@ COPY . /app/
|
|
| 10 |
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Set environment variables for Matplotlib and
|
| 14 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 15 |
ENV XDG_CACHE_HOME=/tmp
|
|
|
|
| 16 |
|
| 17 |
-
# Ensure
|
| 18 |
-
RUN mkdir -p /tmp/matplotlib /tmp/numba_cache
|
|
|
|
| 19 |
|
| 20 |
# Expose port 7860 (Hugging Face default)
|
| 21 |
EXPOSE 7860
|
|
|
|
| 10 |
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Set environment variables for Matplotlib, cache, and rembg models
|
| 14 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 15 |
ENV XDG_CACHE_HOME=/tmp
|
| 16 |
+
ENV U2NET_HOME=/tmp/u2net # Ensure rembg can download models to a writable directory
|
| 17 |
|
| 18 |
+
# Ensure necessary directories exist and have the right permissions
|
| 19 |
+
RUN mkdir -p /tmp/matplotlib /tmp/numba_cache /tmp/u2net && \
|
| 20 |
+
chmod -R 777 /tmp/matplotlib /tmp/numba_cache /tmp/u2net
|
| 21 |
|
| 22 |
# Expose port 7860 (Hugging Face default)
|
| 23 |
EXPOSE 7860
|