Aayan873 commited on
Commit
046ad60
·
verified ·
1 Parent(s): ce97e36

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -1,5 +1,18 @@
1
  FROM python:3.10-slim
2
  WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ENV PYTHONUNBUFFERED=1
4
 
5
  # System deps (Trixie-safe)
@@ -20,16 +33,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
20
  COPY requirements.txt /app/requirements.txt
21
  RUN python -m pip install --upgrade pip setuptools wheel && \
22
  pip install --no-cache-dir -r requirements.txt
23
- RUN mkdir -p /app/.cache/huggingface /app/.cache/torch /tmp/hf && \
24
- chmod -R 777 /app/.cache /tmp/hf
25
- ENV HF_HOME=/app/.cache/huggingface \
26
- TRANSFORMERS_CACHE=/app/.cache/huggingface \
27
- HUGGINGFACE_HUB_CACHE=/app/.cache/huggingface \
28
- HF_DATASETS_CACHE=/app/.cache/huggingface \
29
- SENTENCE_TRANSFORMERS_HOME=/app/.cache/huggingface \
30
- XDG_CACHE_HOME=/app/.cache \
31
- TORCH_HOME=/app/.cache/torch \
32
- TOKENIZERS_PARALLELISM=false
33
  COPY . /app
34
  EXPOSE 7860
35
  HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
 
1
  FROM python:3.10-slim
2
  WORKDIR /app
3
+ # Writable caches for HF/torch
4
+ RUN mkdir -p /tmp/hf /tmp/torch && chmod -R 777 /tmp/hf /tmp/torch
5
+
6
+ # Point all caches to /tmp
7
+ ENV HF_HOME=/tmp/hf \
8
+ TRANSFORMERS_CACHE=/tmp/hf \
9
+ HUGGINGFACE_HUB_CACHE=/tmp/hf \
10
+ HF_DATASETS_CACHE=/tmp/hf \
11
+ SENTENCE_TRANSFORMERS_HOME=/tmp/hf \
12
+ XDG_CACHE_HOME=/tmp \
13
+ TORCH_HOME=/tmp/torch \
14
+ TOKENIZERS_PARALLELISM=false
15
+
16
  ENV PYTHONUNBUFFERED=1
17
 
18
  # System deps (Trixie-safe)
 
33
  COPY requirements.txt /app/requirements.txt
34
  RUN python -m pip install --upgrade pip setuptools wheel && \
35
  pip install --no-cache-dir -r requirements.txt
36
+
 
 
 
 
 
 
 
 
 
37
  COPY . /app
38
  EXPOSE 7860
39
  HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1