27 lines
1.1 KiB
Docker
27 lines
1.1 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
|
|
RUN pip freeze
|
|
|
|
# CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "app:app"]
|
|
CMD ["uvicorn", "--host", "0.0.0.0", "--port", "5000", "--workers", "1", "--log-level", "info", "app:app"]
|
|
|
|
# docker build -t fetcher_cv .
|
|
# docker run --rm -p 5000:5000 fetcher_cv |