mike23415 commited on
Commit
28a5061
·
verified ·
1 Parent(s): 125b5d0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -3
Dockerfile CHANGED
@@ -8,9 +8,9 @@ RUN apt-get update && apt-get install -y \
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Create directory for cache
12
- RUN mkdir -p /tmp/.cache/huggingface && \
13
- chmod -R 777 /tmp/.cache
14
 
15
  # Copy requirements and install dependencies
16
  COPY requirements.txt .
@@ -19,6 +19,11 @@ RUN pip install --no-cache-dir -r requirements.txt
19
  # Copy application code
20
  COPY app.py .
21
 
 
 
 
 
 
22
  # Expose the port
23
  EXPOSE 7860
24
 
 
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create writable cache directories
12
+ RUN mkdir -p /tmp/transformers_cache /tmp/hf_home /tmp/cache /tmp/diffusers_cache && \
13
+ chmod -R 777 /tmp
14
 
15
  # Copy requirements and install dependencies
16
  COPY requirements.txt .
 
19
  # Copy application code
20
  COPY app.py .
21
 
22
+ # Set environment variables
23
+ ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
24
+ ENV HF_HOME=/tmp/hf_home
25
+ ENV XDG_CACHE_HOME=/tmp/cache
26
+
27
  # Expose the port
28
  EXPOSE 7860
29