LogicGoInfotechSpaces commited on
Commit
fb62abc
·
verified ·
1 Parent(s): 4bdce0f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use official PyTorch image with CUDA support (T4 compatible)
2
  FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
3
 
4
  # Disable pip cache
@@ -7,20 +7,23 @@ ENV PIP_NO_CACHE_DIR=1
7
  # Set working directory
8
  WORKDIR /app
9
 
10
- # Copy requirements first (cache-efficient)
11
  COPY requirements.txt .
12
 
13
  # Install dependencies
14
  RUN pip install --upgrade pip
15
  RUN pip install -r requirements.txt
16
 
17
- # Now copy the actual application code
 
 
 
 
 
18
  COPY . .
19
 
20
- # Expose FastAPI port
21
  EXPOSE 7860
22
 
23
- # Run FastAPI (NO reload in production)
24
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
25
-
26
-
 
1
+ # Use official PyTorch image
2
  FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
3
 
4
  # Disable pip cache
 
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
 
17
+ # --- CACHE BUSTING LAYER ---
18
+ # Change the number below (e.g., to 2, 3) whenever you change code
19
+ # and the server doesn't update.
20
+ ENV BUILD_VERSION=2
21
+
22
+ # Copy application code
23
  COPY . .
24
 
25
+ # Expose port
26
  EXPOSE 7860
27
 
28
+ # Run FastAPI
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]