File size: 598 Bytes
fb62abc
3d8734c
 
fab68f1
 
 
3d8734c
 
 
fb62abc
3d8734c
 
fab68f1
3d8734c
fab68f1
3d8734c
fb62abc
 
 
 
 
 
fab68f1
3d8734c
fb62abc
fab68f1
3d8734c
fb62abc
fab68f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use official PyTorch image
FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime

# Disable pip cache
ENV PIP_NO_CACHE_DIR=1

# Set working directory
WORKDIR /app

# Copy requirements first
COPY requirements.txt .

# Install dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# --- CACHE BUSTING LAYER ---
# Change the number below (e.g., to 2, 3) whenever you change code 
# and the server doesn't update.
ENV BUILD_VERSION=2 

# Copy application code
COPY . .

# Expose port
EXPOSE 7860

# Run FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]