docs: Add Docker Optimization & Build Cache Management section
DOCUMENTATION UPDATE (Nov 26, 2025):
User quote: "ok. dont forget the documentation"
Added comprehensive Docker Optimization section covering:
1. MULTI-STAGE BUILDS (already implemented):
- Verified Dockerfile uses builder → runner pattern
- Benefits: Smaller images, faster builds, better layer reuse
2. BUILDKIT AUTO-CLEANUP (just configured):
- Updated /etc/docker/daemon.json with 20GB threshold
- Auto garbage collection when cache exceeds limit
- Docker restarted, BuildKit v0.14.1 active
- Current baseline: 11.13GB cache (healthy)
3. AUTOMATED CLEANUP SCRIPT (ready to use):
- Script: /home/icke/traderv4/cleanup_trading_bot.sh (94 lines)
- Features: Keeps last 2 images, prunes cache, protects volumes
- Usage: Manual (after builds) or automated (cron daily)
- Typical savings: 40-50 GB per run
WHY THIS MATTERS:
- User previously hit 40GB cache accumulation
- BuildKit auto-cleanup provides 20GB safety net
- Manual script gives on-demand control
- Documented process for team reference
IMPLEMENTATION STATUS:
Multi-stage builds confirmed in Dockerfile
BuildKit configured in daemon.json (20GB threshold)
Cleanup script exists and executable
Docker daemon restarted with new config
Current disk usage healthy (11.13GB < 20GB)
Files documented:
- /etc/docker/daemon.json (BuildKit config)
- /home/icke/traderv4/cleanup_trading_bot.sh (manual cleanup)
- Dockerfile (multi-stage builds)
Added monitoring commands, usage recommendations, safety measures,
and typical space savings data for team reference.