toxic-detector/Dockerfile

24 lines
726 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Dockerfile
FROM python:3.11-alpine
# Установка системных зависимостей
RUN apk update && apk add --no-cache \
build-base \
libffi-dev \
openssl-dev \
&& rm -rf /var/cache/apk/*
COPY app /app
# Установка зависимостей
RUN pip install --upgrade pip
RUN pip install -r app/requirements.txt
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
# Экспонирование порта
EXPOSE 8002
# Команда запуска приложения с использованием Gunicorn и Uvicorn workers
CMD ["gunicorn", "app.main:app", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8002", "--workers", "4"]