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 \