File size: 543 Bytes
c25654b
 
 
 
31db4cf
 
 
 
 
 
 
 
c25654b
 
31db4cf
c25654b
 
 
 
 
 
 
00d3183
31db4cf
 
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
FROM python:3.10-slim

WORKDIR /app

# Cài system libs cần cho OpenCV headless + torch
RUN apt-get update && apt-get install -y \
    libglib2.0-0 \
    libsm6 \
    libxrender1 \
    libxext6 \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip

# Torch CPU
RUN pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY app ./app

EXPOSE 7860

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]