GDMProjects commited on
Commit
1234dbc
·
verified ·
1 Parent(s): 93a36b7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -0
Dockerfile CHANGED
@@ -9,6 +9,17 @@ RUN apt-get update \
9
  # App workdir
10
  WORKDIR /app
11
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Copy files first (owned by root initially)
13
  COPY app.py .
14
  COPY requirements.txt .
 
9
  # App workdir
10
  WORKDIR /app
11
 
12
+ # ---- HF hub persistent writable cache (Fix B) ----
13
+ # Use /data (persistent on Spaces) so models aren't re-downloaded every restart
14
+ ENV HOME=/app \
15
+ HF_HOME=/data/.hf \
16
+ HUGGINGFACE_HUB_CACHE=/data/.hf/cache \
17
+ TRANSFORMERS_CACHE=/data/.cache/huggingface
18
+ # Pre-create and open permissions for the runtime (non-root) user
19
+ RUN mkdir -p /data/.hf/cache /data/.cache/huggingface \
20
+ && chmod -R a+rw /data
21
+ # --------------------------------------------------
22
+
23
  # Copy files first (owned by root initially)
24
  COPY app.py .
25
  COPY requirements.txt .