LogicGoInfotechSpaces commited on
Commit
dd9b275
·
verified ·
1 Parent(s): 190f26a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -22
Dockerfile CHANGED
@@ -1,35 +1,21 @@
1
- # Use official PyTorch image
2
  FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
3
 
4
- # Disable pip cache
5
- ENV PIP_NO_CACHE_DIR=1
6
-
7
  # Set working directory
8
  WORKDIR /app
9
 
10
- # Copy requirements first
11
  COPY requirements.txt .
12
 
13
- # # Install dependencies
14
- # RUN pip install --upgrade pip
15
- # RUN pip install -r requirements.txt
16
- RUN pip install --upgrade pip setuptools wheel
17
-
18
- # Force reinstall critical libraries (VERY IMPORTANT)
19
- RUN pip install --no-cache-dir --force-reinstall "huggingface_hub>=0.23.0"
20
-
21
- RUN pip install --no-cache-dir -r requirements.txt
22
-
23
- # --- CACHE BUSTING LAYER ---
24
- # Change the number below (e.g., to 2, 3) whenever you change code
25
- # and the server doesn't update.
26
- ENV BUILD_VERSION=2
27
 
28
- # Copy application code
29
  COPY . .
30
 
31
- # Expose port
32
  EXPOSE 7860
33
 
34
  # Run FastAPI
35
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # PyTorch GPU runtime
2
  FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
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 && \
12
+ pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ # Copy project files
15
  COPY . .
16
 
17
+ # Hugging Face Spaces port
18
  EXPOSE 7860
19
 
20
  # Run FastAPI
21
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]