toxic-detector/Dockerfile

18 lines
480 B
Docker
Raw Normal View History

2024-10-22 23:22:01 +02:00
FROM python:3.11-slim
2024-10-22 22:51:03 +02:00
2024-10-22 23:22:01 +02:00
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
2024-10-22 22:51:03 +02:00
libffi-dev \
2024-10-22 23:22:01 +02:00
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
2024-10-22 22:51:03 +02:00
2024-10-22 23:06:16 +02:00
COPY app /app
2024-10-22 22:51:03 +02:00
RUN pip install --upgrade pip
2024-10-22 23:07:50 +02:00
RUN pip install -r app/requirements.txt
2024-10-22 22:57:23 +02:00
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
2024-10-22 22:51:03 +02:00
2024-10-22 22:54:00 +02:00
EXPOSE 8002
2024-10-22 22:51:03 +02:00
2024-10-22 23:08:30 +02:00
CMD ["gunicorn", "app.main:app", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8002", "--workers", "4"]