Install CPU-only torch and drop playwright - 9.2GB image on a GPU-less VPS
Measured inside the image: 2.7GB of nvidia/ CUDA libraries and 691MB of triton/, on a single-CPU VPS with no GPU. sentence-transformers pulls torch in transitively, and pip's default Linux wheel bundles the whole CUDA stack because it cannot know the target has none. That is ~3.4GB of code that can never execute, in a 9.2GB image on a 48GB disk shared with a dozen other services - and a build here has already failed once on "no space left on device". torch now installs first from PyTorch's CPU index, so the requirements.txt pass finds it satisfied and leaves it alone. playwright is commented out rather than deleted. It is the last-resort image-search tier and the Dockerfile never installs its browser binary, so in a container the tier is skipped at runtime regardless while the package still costs 137MB. Its import is lazy, so absence takes the existing "not installed" path rather than breaking anything. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,13 @@ aiofiles>=23.2.1
|
||||
# Playwright (Python) - last-resort image-search fallback only.
|
||||
# Run `playwright install chromium` once after pip install to enable it;
|
||||
# the pipeline works fine without it (just one fewer fallback source).
|
||||
playwright>=1.47.0
|
||||
# playwright>=1.47.0
|
||||
# Commented out, not deleted. It is the last-resort image-search tier, and the
|
||||
# Dockerfile never installs its browser binary - so in a container the tier is
|
||||
# skipped at runtime no matter what, while the package still costs 137MB. The
|
||||
# import is lazy (app/services/playwright_image_fallback.py does it inside the
|
||||
# function), so its absence is handled on the existing "not installed" path.
|
||||
# Uncomment, and run `playwright install chromium`, if you ever want that tier.
|
||||
|
||||
# --- S3 / DigitalOcean Spaces (optional product image storage) ---
|
||||
boto3>=1.34.162
|
||||
|
||||
Reference in New Issue
Block a user