From 762048d71f18ffb1b64cd55197c75bc0b0e9c4c0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Aug 2026 00:03:09 +0000 Subject: [PATCH] fix(docker): install slowapi in Dockerfile.production so the image starts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/youtube_extension/main.py imports slowapi unconditionally at module top level (Limiter, SlowAPIMiddleware, rate-limit handler) and binds it at import time. The production image's CMD is youtube_extension.main:app, but the pip install list omitted slowapi (requirements.txt is copied, not installed), so every container built from this file exited immediately at startup with: ModuleNotFoundError: No module named 'slowapi' slowapi>=0.1.8 is a canonical dependency in both requirements.txt and pyproject.toml; the added floor matches. This is the same 'image never verified to start' defect class as the earlier server:app CMD fix, one import deeper — flagged by Vercel VADE review on #1122 and #1128 and independently verified, then shipped to main when #1128 merged. The existing floor guard did not catch this because it only validates packages already present in the install list, never asserting that every canonical runtime import resolves to an installed pin. Verified: tests/unit/test_security_fixes.py Dockerfile guards — 5 passed. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01F6KJmeCL8QnxYEKuVimf9J --- infrastructure/docker/Dockerfile.production | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure/docker/Dockerfile.production b/infrastructure/docker/Dockerfile.production index 82656418e..9a403b622 100644 --- a/infrastructure/docker/Dockerfile.production +++ b/infrastructure/docker/Dockerfile.production @@ -42,7 +42,8 @@ RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted "aiofiles>=23.2.1" \ "httpx>=0.25.0" \ "requests>=2.31.0" \ - "python-multipart>=0.0.31" + "python-multipart>=0.0.31" \ + "slowapi>=0.1.8" # Create necessary directories and set permissions RUN mkdir -p logs && \