kettui reported the dev image roughly doubled in size after a recent nightly build. codex investigation traced it back to: 1. nightly workflow runs `python -m pytest` before docker build 2. one of the new tests imports web_server (test_tidal_auth_instructions.py) 3. importing web_server constructs YouTubeClient 4. YouTubeClient.__init__ called _check_ffmpeg() — which auto-downloads a ~388 MB ffmpeg/ffprobe bundle into ./tools/ when system ffmpeg isn't on PATH (CI runner doesn't have it) 5. .dockerignore didn't exclude tools/ffmpeg or tools/ffprobe 6. docker `COPY . .` shipped the binaries 7. the immediately-following `chown -R /app` rewrote every file into a new layer — so the 388 MB payload got counted twice in image size three fixes: 1. .dockerignore — block the auto-downloaded binaries even if they leak into the workspace (tools/ffmpeg, tools/ffprobe, .exe variants, .zip and .tar.xz download archives). Defense-in-depth so a future regression in the test/import path can't bloat the image again. 2. youtube_client — split _check_ffmpeg into a side-effect-free _locate_ffmpeg (pure existence check) and the original auto- download _check_ffmpeg. __init__ now calls _locate_ffmpeg + logs a warning when missing instead of triggering download. is_available() and the actual download dispatch paths still call _check_ffmpeg — so end users still get auto-download on first YouTube use, but `import web_server` doesn't drag a 388 MB binary into the workspace. 3. Dockerfile — replaced `COPY . .` + `chown -R /app` with `COPY --chown=soulsync:soulsync . .` + a scoped chown on just the runtime mount-point dirs. eliminates the layer that duplicated the entire /app tree just to flip ownership bits, so even legit workspace content isn't double-counted in the image. Combined effect: image size returns to baseline + future ffmpeg leaks can't bloat it. Inside the container nothing changes — the Dockerfile already installs system ffmpeg via apt, so YouTube downloads find it on PATH on first use and the auto-download path never fires. 2259 passed, 1 skipped, 0 failed.
90 lines
1.5 KiB
Text
90 lines
1.5 KiB
Text
# Docker ignore file for SoulSync WebUI
|
|
|
|
# Hidden folders and files
|
|
.*
|
|
|
|
# Git
|
|
.git
|
|
.gitignore
|
|
.gitattributes
|
|
|
|
# IDE and editor files
|
|
.vscode/
|
|
.idea/
|
|
*.swp
|
|
*.swo
|
|
*~
|
|
|
|
# Python
|
|
__pycache__/
|
|
*.py[cod]
|
|
*$py.class
|
|
*.so
|
|
.Python
|
|
*.egg-info/
|
|
dist/
|
|
build/
|
|
|
|
# Virtual environments
|
|
venv/
|
|
env/
|
|
ENV/
|
|
|
|
# Data directories (will be mounted as volumes)
|
|
logs/*
|
|
!logs/.gitkeep
|
|
database/*.db
|
|
database/*.db-shm
|
|
database/*.db-wal
|
|
config/config.json
|
|
!config/config.example.json
|
|
downloads/*
|
|
!downloads/.gitkeep
|
|
Transfer/*
|
|
!Transfer/.gitkeep
|
|
Storage/*
|
|
cache/*
|
|
Stream/*
|
|
Incomplete/*
|
|
|
|
# Temporary files
|
|
artist_bubble_snapshots.json
|
|
.spotify_cache
|
|
|
|
# Auto-downloaded ffmpeg binaries — the YouTube client downloads these
|
|
# into tools/ when system ffmpeg isn't on PATH. The Dockerfile installs
|
|
# system ffmpeg via apt, so the container never needs the bundled
|
|
# binaries. If a CI run leaves them in the workspace before the docker
|
|
# build (e.g. because a test imported web_server which initialized the
|
|
# YouTube client), they'd otherwise get baked into the image — adding
|
|
# ~388 MB and getting duplicated again by the chown layer.
|
|
tools/ffmpeg
|
|
tools/ffprobe
|
|
tools/ffmpeg.exe
|
|
tools/ffprobe.exe
|
|
tools/*.zip
|
|
tools/*.tar.xz
|
|
|
|
# Documentation
|
|
*.md
|
|
README.md
|
|
headless.md
|
|
multi-server-database-plan.md
|
|
server-source.md
|
|
plans.md
|
|
|
|
# GUI-specific files (removed by PR #311)
|
|
main.py
|
|
ui/
|
|
|
|
# Dev-specific files
|
|
requirements-dev.txt
|
|
|
|
# OS generated files
|
|
.DS_Store
|
|
.DS_Store?
|
|
._*
|
|
.Spotlight-V100
|
|
.Trashes
|
|
ehthumbs.db
|
|
Thumbs.db
|