Pulastya0 commited on
Commit
dcbee48
·
verified ·
1 Parent(s): 6d51ae9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -1,22 +1,25 @@
1
- # Use official slim Python image
2
  FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- RUN mkdir -p /data/huggingface-cache
8
- ENV HF_HOME="/tmp/huggingface-cache"
9
- ENV TRANSFORMERS_CACHE="/tmp/huggingface-cache"
10
-
11
- # Copy requirements and install
12
  COPY requirements.txt .
 
 
13
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
14
 
 
 
 
 
 
15
  # Copy app.py
16
  COPY . .
17
 
18
- # Expose default HF port
19
  EXPOSE 7860
20
 
21
- # Use Python to run uvicorn (avoids PATH issues)
22
  CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image
2
  FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy requirements
 
 
 
 
8
  COPY requirements.txt .
9
+
10
+ # Install dependencies
11
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Create writable cache directory for Hugging Face
14
+ RUN mkdir -p /data/huggingface-cache
15
+ ENV HF_HOME="/data/huggingface-cache"
16
+ ENV TRANSFORMERS_CACHE="/data/huggingface-cache"
17
+
18
  # Copy app.py
19
  COPY . .
20
 
21
+ # Expose default HF Space port
22
  EXPOSE 7860
23
 
24
+ # Use python -m uvicorn to avoid PATH issues
25
  CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]