pdarleyjr commited on
Commit
a53ce41
·
1 Parent(s): a4f805a

Update Dockerfile with proper Hugging Face cache setup

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -8,6 +8,13 @@ RUN apt-get update && \
8
  build-essential \
9
  && rm -rf /var/lib/apt/lists/*
10
 
 
 
 
 
 
 
 
11
  # Copy requirements first for better caching
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
@@ -19,4 +26,4 @@ COPY . .
19
  EXPOSE 7860
20
 
21
  # Command to run the application
22
- CMD ["python", "app.py"]
 
8
  build-essential \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create cache directory and set permissions
12
+ RUN mkdir -p /code/.cache/huggingface && \
13
+ chmod -R 777 /code/.cache
14
+
15
+ # Set environment variable for Hugging Face cache
16
+ ENV HF_HOME=/code/.cache/huggingface
17
+
18
  # Copy requirements first for better caching
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
 
26
  EXPOSE 7860
27
 
28
  # Command to run the application
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]