From 89fa87ba8a1adbf728961219565ec0a8786e5973 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Wed, 29 Apr 2026 22:08:25 +0100 Subject: [PATCH] =?UTF-8?q?refactor(docker):=20remove=20ffmpeg=20from=20ap?= =?UTF-8?q?i/worker=20images=20=E2=80=94=20runs=20on=20Cloud=20Run=20Jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Heavy pipeline tasks (ingest, translate, render, tts) now dispatch to va-worker Cloud Run Job which has its own Dockerfile.cloudrun with ffmpeg. API and lightweight Celery worker (notify/embed) don't need it. Co-Authored-By: Claude Sonnet 4.6 --- backend/Dockerfile | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 0a44c6c..5c4f1f7 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,8 +3,8 @@ # ============================================================================= # Stage 1: Builder - Install dependencies # Stage 2: Base - Common runtime for API and Worker -# Stage 3: API - FastAPI + Gunicorn (with ffmpeg for TTS audio conversion) -# Stage 4: Worker - Celery worker (with ffmpeg for video processing) +# Stage 3: API - FastAPI + Gunicorn (no ffmpeg — heavy tasks run on Cloud Run Jobs) +# Stage 4: Worker - Celery worker, lightweight queues only (notify, embed) # ============================================================================= # ----------------------------------------------------------------------------- @@ -72,21 +72,10 @@ USER app # ----------------------------------------------------------------------------- # Stage 3: API - FastAPI + Gunicorn (Production API Server) +# Heavy pipeline tasks (ingest/translate/render) run on Cloud Run Jobs — no ffmpeg needed here # ----------------------------------------------------------------------------- FROM base AS api -# Switch to root to install ffmpeg -USER root - -# Install ffmpeg for TTS audio conversion -RUN apt-get update && apt-get install -y --no-install-recommends \ - ffmpeg \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get clean - -# Switch back to non-root user -USER app - # Set production environment variables ENV APP_ENV=prod @@ -104,22 +93,11 @@ ENTRYPOINT ["tini", "--"] CMD ["gunicorn", "-c", "gunicorn_conf.py", "app.main:app"] # ----------------------------------------------------------------------------- -# Stage 4: Worker - Celery Worker (with ffmpeg for video processing) +# Stage 4: Worker - Celery Worker (lightweight queues: notify, embed) +# Heavy queues (ingest/translate/render/tts) run on Cloud Run Jobs — no ffmpeg needed here # ----------------------------------------------------------------------------- FROM base AS worker -# Switch back to root to install ffmpeg -USER root - -# Install ffmpeg for video processing -RUN apt-get update && apt-get install -y --no-install-recommends \ - ffmpeg \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get clean - -# Switch back to non-root user -USER app - # Set production environment variables # WORKER_CONCURRENCY can be overridden at runtime (default: 8) ENV APP_ENV=prod \