stpete2 commited on
Commit
e58a295
·
verified ·
1 Parent(s): 61a06ba

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -4
Dockerfile CHANGED
@@ -9,6 +9,18 @@ RUN apt-get update && \
9
  apt-get clean && \
10
  rm -rf /var/lib/apt/lists/*
11
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Copy requirements and install
13
  COPY requirements.txt .
14
  RUN pip3 install --no-cache-dir -r requirements.txt
@@ -16,11 +28,9 @@ RUN pip3 install --no-cache-dir -r requirements.txt
16
  # Copy app files
17
  COPY app.py .
18
 
19
- # Set environment variables for HF
20
- ENV HF_HOME=/code
21
-
22
  # Expose port
23
  EXPOSE 7860
24
 
25
  # Run the application with proper host to expose externally
26
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
9
  apt-get clean && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
+ # Create cache directories with proper permissions
13
+ RUN mkdir -p /tmp/transformers_cache && \
14
+ mkdir -p /tmp/hf_home && \
15
+ mkdir -p /tmp/hf_datasets_cache && \
16
+ mkdir -p /tmp/diffusers_cache && \
17
+ chmod -R 777 /tmp
18
+
19
+ # Set environment variables for HF
20
+ ENV HF_HOME=/tmp/hf_home
21
+ ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
22
+ ENV HF_DATASETS_CACHE=/tmp/hf_datasets_cache
23
+
24
  # Copy requirements and install
25
  COPY requirements.txt .
26
  RUN pip3 install --no-cache-dir -r requirements.txt
 
28
  # Copy app files
29
  COPY app.py .
30
 
 
 
 
31
  # Expose port
32
  EXPOSE 7860
33
 
34
  # Run the application with proper host to expose externally
35
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
36
+