Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -1,21 +1,22 @@
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
COPY requirements.txt .
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy application files
|
| 14 |
COPY . /app/
|
| 15 |
|
| 16 |
-
# Expose
|
| 17 |
-
EXPOSE
|
| 18 |
|
| 19 |
-
# Run
|
| 20 |
-
CMD ["
|
| 21 |
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
| 3 |
+
# 1. Create a writable cache directory for huggingface_hub
|
| 4 |
+
RUN mkdir -p /tmp/huggingface_cache
|
| 5 |
+
ENV HUGGINGFACE_HUB_CACHE=/tmp/huggingface_cache
|
| 6 |
|
| 7 |
+
# 2. Create a writable cache directory for Numba (used by rembg/pymatting)
|
| 8 |
+
RUN mkdir -p /tmp/numba_cache
|
| 9 |
+
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
|
| 10 |
|
| 11 |
+
WORKDIR /app
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
|
|
|
| 15 |
COPY . /app/
|
| 16 |
|
| 17 |
+
# 3. Expose port 7860 for Hugging Face
|
| 18 |
+
EXPOSE 7860
|
| 19 |
|
| 20 |
+
# 4. Run your main.py (which calls uvicorn.run inside the __main__ block)
|
| 21 |
+
CMD ["python", "main.py"]
|
| 22 |
|