Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Use official PyTorch image
|
| 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
|
| 11 |
COPY requirements.txt .
|
| 12 |
|
| 13 |
# Install dependencies
|
| 14 |
RUN pip install --upgrade pip
|
| 15 |
RUN pip install -r requirements.txt
|
| 16 |
|
| 17 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
COPY . .
|
| 19 |
|
| 20 |
-
# Expose
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
-
# Run FastAPI
|
| 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"]
|
|
|
|
|
|