Files
matitos_news/app_cv/Dockerfile
2025-04-30 18:41:35 +02:00

28 lines
1.0 KiB
Docker

FROM python:3.12
WORKDIR /app
# LibGL for OpenCV
RUN apt-get update && apt-get install libgl1 -y
# Download models
RUN mkdir models
# https://github.com/wildchlamydia/mivolo
RUN curl "https://drive.usercontent.google.com/download?id=11i8pKctxz3wVkDBlWKvhYIh7kpVFXSZ4&confirm=xxx" -o models/model_imdb_cross_person_4.22_99.46.pth.tar
RUN curl "https://drive.usercontent.google.com/download?id=1CGNCkZQNj5WkP3rLpENWAOgrBQkUWRdw&confirm=xxx" -o models/yolov8x_person_face.pt
# https://github.com/notAI-tech/NudeNet
# Upload to an accessible link: https://github.com/notAI-tech/NudeNet/releases/download/v3.4-weights/640m.onnx
RUN curl "https://drive.usercontent.google.com/download?id=1lHTrW1rmYoYnMSUlhLwqFCW61-w2hvKX&confirm=xxx" -o models/640m.onnx
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
# CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "app:app"]
CMD ["uvicorn", "--port", "5000", "--workers", "2", "app:app"]
# docker build -t fetcher_cv .
# docker run --rm -p 5000:5000 fetcher_cv