File size: 796 Bytes
b5eccf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

RUN apt-get update && apt-get install -y \
    git libgl1 libglib2.0-0 libsm6 libxext6 libxrender-dev libgomp1 \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH

COPY --chown=user requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --user -r requirements.txt

# Pre-download models
RUN python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"
RUN python -c "import open_clip; open_clip.create_model_and_transforms('ViT-L-16-SigLIP-256', pretrained='webli')"

COPY --chown=user app_gradio.py /app/app.py
COPY --chown=user icon_model_hybrid /app/icon_model_hybrid

EXPOSE 7860

CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]