24 lines
760 B
Docker
24 lines
760 B
Docker
# Dockerfile
|
||
|
||
FROM python:3.11-slim
|
||
|
||
# Установка системных зависимостей
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
build-essential \
|
||
libffi-dev \
|
||
libssl-dev \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
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"]
|