File size: 604 Bytes
717b5e6
3aca1f8
717b5e6
3aca1f8
 
 
 
 
 
 
 
 
 
 
 
717b5e6
 
 
 
 
 
 
3aca1f8
717b5e6
3aca1f8
717b5e6
3aca1f8
717b5e6
3aca1f8
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
FROM python:3.10-slim
 
WORKDIR /app
 
# Install system libraries required by opencv
RUN apt-get update && apt-get install -y \
    libxcb1 \
    libglib2.0-0 \
    libgl1 \
    && rm -rf /var/lib/apt/lists/*
 
# Install headless opencv first (no display needed on a server)
RUN pip install --no-cache-dir opencv-python-headless
 
# Install the rest of the dependencies
RUN pip install --no-cache-dir \
    fastapi \
    uvicorn \
    python-multipart \
    ultralytics \
    huggingface_hub \
    pillow
 
COPY app.py .
 
EXPOSE 7860
 
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]