Рабочий пайплайн: YouTube -> транскрипция -> выжимка -> Postgres

- новый api/: /pipeline/process (yt-dlp, субтитры или Vosk, LLM/экстрактивная
  суммаризация), /videos, /llm; старый код перенесён в api_legacy/
- web/: Flet UI (flet 0.28.3 + flet-web, порт 8550)
- Dockerfile.api: ffmpeg слоем из mwader/static-ffmpeg, pip с кэш-маунтом
- requirements/pyproject: убраны moviepy, imageio-ffmpeg, битый asyncio
- README с инструкцией запуска и загрузкой Vosk-модели

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jze9
2026-07-14 11:12:46 +05:00
parent 564c9c2d2f
commit 2697e01714
51 changed files with 2313 additions and 284 deletions

View File

@@ -1,51 +1,16 @@
# syntax=docker/dockerfile:1.5
# Builder: install build deps and build wheels
FROM python:3.14-slim AS builder
FROM python:3.14-slim
WORKDIR /app
#RUN apt-get update && apt-get install -y --no-install-recommends \
# build-essential \
# ca-certificates \
# && rm -rf /var/lib/apt/lists/*
#
# Static ffmpeg/ffprobe as a cached image layer — no apt, no slow mirror downloads
COPY --from=mwader/static-ffmpeg:7.1 /ffmpeg /ffprobe /usr/local/bin/
# Deps first for layer caching; BuildKit cache mount speeds up rebuilds
COPY requirements.txt ./
# Build wheels into /wheels (use cache for pip downloads)
RUN --mount=type=cache,target=/root/.cache/pip \
pip wheel --no-cache-dir -r requirements.txt -w /wheels
pip install -r requirements.txt
# Application code (data/, models/, pg_data/ excluded via .dockerignore)
COPY . .
# Final image: small and without build tools
FROM python:3.14-slim AS final
WORKDIR /app
## minimal runtime deps (use static ffmpeg to avoid many apt deps)
#RUN apt-get update && apt-get install -y --no-install-recommends \
# ca-certificates \
# curl \
# && rm -rf /var/lib/apt/lists/*
# Copy wheels from builder and install
COPY --from=builder /wheels /wheels
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-cache-dir /wheels/* || pip install --no-cache-dir /wheels/* --no-deps
# Download a static ffmpeg build (faster than installing via apt and avoids many deps)
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
if [ "$arch" = "amd64" ]; then \
FFMPEG_URL="https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz"; \
else \
echo "Unsupported arch $arch"; exit 1; \
fi; \
curl -fsSL "$FFMPEG_URL" -o /tmp/ffmpeg.tar.xz; \
tar -xJf /tmp/ffmpeg.tar.xz -C /tmp; \
cp /tmp/ffmpeg-*-amd64-static/ffmpeg /usr/local/bin/; \
cp /tmp/ffmpeg-*-amd64-static/ffprobe /usr/local/bin/; \
chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe; \
rm -rf /tmp/ffmpeg*
# Copy application code (exclude models/data via .dockerignore)
COPY . ./api
CMD ["python", "-m", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["python", "-m", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]