Spaces:
Sleeping
Sleeping
Commit ·
064e77c
1
Parent(s): e0949ca
HF: force writable hub cache (/tmp/hf)
Browse files- Dockerfile +8 -1
Dockerfile
CHANGED
|
@@ -3,6 +3,13 @@ FROM python:3.11-slim
|
|
| 3 |
# Ensure build logs flush immediately (helps when HF shows “BUILDING” with no output)
|
| 4 |
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# System dependencies for OpenCV and image processing
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
libgl1 \
|
|
@@ -19,7 +26,7 @@ WORKDIR /app
|
|
| 19 |
|
| 20 |
# Build-time info + cache-bust:
|
| 21 |
# Changing APP_BUILD forces Docker to re-run subsequent layers (including pip install).
|
| 22 |
-
ARG APP_BUILD=
|
| 23 |
ENV APP_BUILD=${APP_BUILD}
|
| 24 |
RUN echo "Docker build start: APP_BUILD=${APP_BUILD}" && python -V
|
| 25 |
|
|
|
|
| 3 |
# Ensure build logs flush immediately (helps when HF shows “BUILDING” with no output)
|
| 4 |
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
| 6 |
+
# Hugging Face Hub cache:
|
| 7 |
+
# Some Spaces build steps scan/download using the local Hugging Face cache.
|
| 8 |
+
# In containers this cache can be missing/unwritable unless we force it.
|
| 9 |
+
ENV HF_HOME=/tmp/hf
|
| 10 |
+
ENV HF_HUB_CACHE=/tmp/hf/hub
|
| 11 |
+
ENV TRANSFORMERS_CACHE=/tmp/hf/transformers
|
| 12 |
+
|
| 13 |
# System dependencies for OpenCV and image processing
|
| 14 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 15 |
libgl1 \
|
|
|
|
| 26 |
|
| 27 |
# Build-time info + cache-bust:
|
| 28 |
# Changing APP_BUILD forces Docker to re-run subsequent layers (including pip install).
|
| 29 |
+
ARG APP_BUILD=10
|
| 30 |
ENV APP_BUILD=${APP_BUILD}
|
| 31 |
RUN echo "Docker build start: APP_BUILD=${APP_BUILD}" && python -V
|
| 32 |
|