File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -216,18 +216,24 @@ fly-deploy-development:
216216fly-deploy-demo-fresh :
217217 @echo " 🧹 Cleaning local Docker cache to ensure fresh build..."
218218 docker system prune -f --filter " until=1h"
219+ @echo " 🧹 Cleaning Docker builder cache..."
220+ docker builder prune -f 2> /dev/null || true
219221 ./scripts/deployment/deploy_fly.sh --profile demo --force-rebuild
220222
221223# deploy with fresh build (clears local Docker cache first) - production profile
222224fly-deploy-production-fresh :
223225 @echo " 🧹 Cleaning local Docker cache to ensure fresh build..."
224226 docker system prune -f --filter " until=1h"
227+ @echo " 🧹 Cleaning Docker builder cache..."
228+ docker builder prune -f 2> /dev/null || true
225229 ./scripts/deployment/deploy_fly.sh --profile production --force-rebuild
226230
227231# deploy with fresh build (clears local Docker cache first) - development profile
228232fly-deploy-development-fresh :
229233 @echo " 🧹 Cleaning local Docker cache to ensure fresh build..."
230234 docker system prune -f --filter " until=1h"
235+ @echo " 🧹 Cleaning Docker builder cache..."
236+ docker builder prune -f 2> /dev/null || true
231237 ./scripts/deployment/deploy_fly.sh --profile development --force-rebuild
232238
233239# test fly.io build locally before deploying (helps catch issues early)
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ FROM python:3.12-slim
33# Cache busting argument (set during build to force fresh layers)
44ARG CACHEBUST=1
55
6+ # Use CACHEBUST to invalidate cache when needed (this layer changes when CACHEBUST changes)
7+ RUN echo "Cache bust: $CACHEBUST" > /tmp/cachebust
8+
69# Install system dependencies including nginx
710RUN apt-get update && apt-get install -y --no-install-recommends \
811 git \
Original file line number Diff line number Diff line change @@ -235,10 +235,23 @@ rm fly.toml.bak
235235echo " 🚀 Deploying application..."
236236
237237if [[ " $FORCE_REBUILD " == " true" ]]; then
238+ # Generate unique cache busting value with timestamp + random
239+ CACHEBUST_VALUE=" $( date +%s) -$( openssl rand -hex 4 2> /dev/null || echo $RANDOM ) "
238240 echo " 🔄 Force rebuild enabled - using aggressive cache busting..."
239- fly deploy --no-cache --build-arg CACHEBUST=" $( date +%s) " -a " $APP_NAME "
241+ echo " 🎯 Cache bust value: $CACHEBUST_VALUE "
242+
243+ # Use multiple cache busting strategies:
244+ # 1. --no-cache: Skip Docker layer cache
245+ # 2. CACHEBUST build arg: Force rebuild of layers that use it
246+ # 3. --dockerfile: Explicit dockerfile path to avoid confusion
247+ fly deploy \
248+ --no-cache \
249+ --build-arg CACHEBUST=" $CACHEBUST_VALUE " \
250+ --dockerfile docker/Dockerfile.fly \
251+ -a " $APP_NAME "
240252else
241- fly deploy --no-cache -a " $APP_NAME "
253+ echo " ⚡ Standard deployment (with caching)..."
254+ fly deploy --dockerfile docker/Dockerfile.fly -a " $APP_NAME "
242255fi
243256
244257# Show the status
You can’t perform that action at this time.
0 commit comments