transcription/Dockerfile
2026-05-29 18:04:38 +03:00

44 lines
1.3 KiB
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.

# syntax=docker/dockerfile:1
FROM python:3.11-slim-bookworm
# Установка системных зависимостей
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
build-essential \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
# Рабочая директория
WORKDIR /app
# Копируем зависимости
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Копируем код проекта
COPY . .
# Предзагрузка моделей (HF_TOKEN передаётся через build args)
ARG HF_TOKEN
ENV HF_TOKEN=$HF_TOKEN
RUN if [ -n "$HF_TOKEN" ]; then \
echo "[Build] Загрузка моделей с HF_TOKEN..."; \
python scripts/download_models.py; \
else \
echo "[Build] HF_TOKEN не передан — модели загрузятся при первом запуске"; \
fi
# Создаём директории для данных
RUN mkdir -p uploads processed tmp
# Открываем порт
EXPOSE 8000
# Entrypoint скрипт
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]