Always rebuild frontend with --no-cache in deploy script

Next.js builds inside Docker's multi-stage builder get cached even when
source files change, causing stale frontends after deploy. Backend still
uses normal caching since Python doesn't have this issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
DJP 2026-04-10 20:18:00 -04:00
parent dd59c81603
commit 5681ca4acf

View file

@ -221,12 +221,15 @@ log "Pulling latest code..."
git pull --ff-only || error "Git pull failed. Resolve conflicts manually."
# Build images
# Frontend always gets --no-cache to avoid stale Next.js builds from Docker layer cache
if [ "$REBUILD" = true ]; then
log "Rebuilding all images (no cache)..."
$COMPOSE build --no-cache
else
log "Building updated images..."
$COMPOSE build
log "Building backend..."
$COMPOSE build backend celery_worker
log "Building frontend (no cache)..."
$COMPOSE build --no-cache frontend
fi
# Run migrations (safe to run even if nothing changed)