Compare commits

..

No commits in common. "ea1904f9af129f49f6e41ae6c2aa9d5eaa4db4de" and "a19cb158164b830822411536198d161e9329c42b" have entirely different histories.

6 changed files with 24 additions and 30 deletions

View File

@ -37,7 +37,6 @@ video/
*.docx
*.md
*.txt
!requirements.txt
# IDE
.vscode/

14
.gitattributes vendored
View File

@ -1,14 +0,0 @@
* text=auto eol=lf
*.sh text eol=lf
*.py text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.json text eol=lf
*.md text eol=lf
*.txt text eol=lf
*.html text eol=lf
*.css text eol=lf
*.js text eol=lf
*.gitignore text eol=lf
*.dockerignore text eol=lf
Dockerfile text eol=lf

1
.gitignore vendored
View File

@ -46,7 +46,6 @@ processed/
!README.md
!AGENTS.md
*.txt
!requirements.txt
!.gitkeep
# IDE

View File

@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
FROM python:3.11-slim-bookworm
# Установка системных зависимостей
@ -5,7 +7,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
build-essential \
libsndfile1 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Рабочая директория
@ -13,16 +14,30 @@ WORKDIR /app
# Копируем зависимости
COPY requirements.txt .
RUN pip install --no-cache-dir --timeout 300 -i https://mirrors.aliyun.com/pypi/simple/ -r 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"]

View File

@ -1,6 +1,11 @@
version: "3.8"
services:
transcription:
image: transcription-transcription:latest
build:
context: .
args:
- HF_TOKEN
container_name: transcription_service
ports:
- "8000:8000"
@ -8,14 +13,11 @@ services:
- .env
environment:
- PYTHONUNBUFFERED=1
- HF_TOKEN=${HF_TOKEN}
volumes:
- uploads:/app/uploads
- processed:/app/processed
- tmp:/app/tmp
restart: unless-stopped
entrypoint: ["uvicorn"]
command: ["backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/files"]
interval: 30s

View File

@ -1,7 +0,0 @@
fastapi
uvicorn[standard]
python-multipart
websockets
python-docx
pyyaml
whisperx