Files
ai-agent/backend/requirements.txt
Gabriel Vidal 9a9071d733 perf(ai-agent): speed up build & skip redundant redeploys
Dockerfile: add BuildKit cache mounts for npm, pip and apt so a dependency
bump or a pruned builder re-installs from the local cache instead of
re-downloading everything (frontend deps are ~250 MB). Switch `npm install`
→ `npm ci` (deterministic, faster) and move the backend deps to
backend/requirements.txt so the pip layer is cache-keyed on that file alone —
editing backend code never re-resolves pip.

deploy.sh: add a no-op short-circuit. BuildKit makes an unchanged build cheap
(~2s), so we build first, hash the fresh image's content layers (RootFS
diff-ids, stable across rebuilds), and compare to a marker written by the last
successful deploy. If they match and the live container is healthy, skip the
whole blue-green dance — a redundant redeploy drops from ~75s to ~3s. Fails
open (missing/stale marker or unhealthy container → normal deploy); --force
overrides the check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 22:17:55 +02:00

321 B