Alp İpekçiler commited on
Commit
b172d89
·
1 Parent(s): e62f4a7

Fix: Add cache environment variables to Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -2,6 +2,14 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
5
  # Install dependencies
6
  COPY requirements.txt requirements.txt
7
  RUN pip install --no-cache-dir -r requirements.txt
@@ -18,4 +26,3 @@ ENV PYTHONUNBUFFERED=1
18
 
19
  # Run app
20
  CMD ["python", "app.py"]
21
-
 
2
 
3
  WORKDIR /app
4
 
5
+ # Set cache directories BEFORE installing dependencies
6
+ ENV HF_HOME=/tmp/.cache
7
+ ENV TRANSFORMERS_CACHE=/tmp/.cache
8
+ ENV TORCH_HOME=/tmp/.cache
9
+
10
+ # Create cache directory
11
+ RUN mkdir -p /tmp/.cache && chmod 777 /tmp/.cache
12
+
13
  # Install dependencies
14
  COPY requirements.txt requirements.txt
15
  RUN pip install --no-cache-dir -r requirements.txt
 
26
 
27
  # Run app
28
  CMD ["python", "app.py"]