File size: 521 Bytes
1bfabc8
 
 
 
35a468d
 
4707166
 
1bfabc8
4707166
 
 
 
 
 
 
1bfabc8
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM python:3.10-slim

WORKDIR /app

ENV NO_PROXY="localhost,127.0.0.1,0.0.0.0"

# Pre-install CPU-only PyTorch to save space and avoid giant CUDA downloads
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu

# Copy requirements first to leverage Docker layer caching
COPY requirements.txt .

# Install the rest of the dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code
COPY app.py .

EXPOSE 7860

CMD ["python", "app.py"]