mike23415 commited on
Commit
b3f64e8
·
verified ·
1 Parent(s): 64a3625

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -2
Dockerfile CHANGED
@@ -27,13 +27,18 @@ RUN pip install --no-cache-dir -r requirements.txt
27
  # Copy application code
28
  COPY app.py .
29
 
30
- # Create directory for model cache
31
- RUN mkdir -p /root/.cache
 
 
32
 
33
  # Set environment variables
34
  ENV FLASK_APP=app.py
35
  ENV FLASK_ENV=production
36
  ENV PYTHONUNBUFFERED=1
 
 
 
37
 
38
  # Expose port
39
  EXPOSE 5000
 
27
  # Copy application code
28
  COPY app.py .
29
 
30
+ # Create cache directories with proper permissions
31
+ RUN mkdir -p /app/.cache/huggingface/hub && \
32
+ mkdir -p /app/.cache/torch && \
33
+ chmod -R 777 /app/.cache
34
 
35
  # Set environment variables
36
  ENV FLASK_APP=app.py
37
  ENV FLASK_ENV=production
38
  ENV PYTHONUNBUFFERED=1
39
+ ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
40
+ ENV HF_HOME=/app/.cache/huggingface
41
+ ENV TORCH_HOME=/app/.cache/torch
42
 
43
  # Expose port
44
  EXPOSE 5000