From bb281b488ba2544493caaf1427c844d2300df165 Mon Sep 17 00:00:00 2001 From: Dorian Date: Fri, 13 Feb 2026 18:05:40 +0000 Subject: [PATCH] Add CACHEBUST build arg to force Docker image rebuilds Docker's build cache was preventing Portainer from picking up code changes. Adding a CACHEBUST ARG before COPY invalidates all subsequent layers when the value changes. Co-authored-by: Cursor --- Dockerfile | 3 +++ backend/Dockerfile | 3 +++ backend/Dockerfile.ffmpeg | 3 +++ docker-compose.yml | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 86b9ce0..0a8b618 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,9 @@ COPY package*.json ./ # Install dependencies RUN npm ci +# Cache-bust: change CACHEBUST value in docker-compose.yml to force rebuild +ARG CACHEBUST=1 + # Copy source code COPY . . diff --git a/backend/Dockerfile b/backend/Dockerfile index d22a9f8..cfdd458 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -5,6 +5,9 @@ WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci --ignore-scripts +# Cache-bust: change CACHEBUST value in docker-compose.yml to force rebuild +ARG CACHEBUST=1 + # Copy source and build COPY . . RUN npm run build diff --git a/backend/Dockerfile.ffmpeg b/backend/Dockerfile.ffmpeg index ec358ba..9219e47 100644 --- a/backend/Dockerfile.ffmpeg +++ b/backend/Dockerfile.ffmpeg @@ -5,6 +5,9 @@ WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci --ignore-scripts +# Cache-bust: change CACHEBUST value in docker-compose.yml to force rebuild +ARG CACHEBUST=1 + COPY . . RUN npm run build RUN npm prune --production diff --git a/docker-compose.yml b/docker-compose.yml index 6229ba7..6e40660 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,7 @@ services: context: . dockerfile: Dockerfile args: + CACHEBUST: "2" VITE_USE_MOCK_DATA: "false" VITE_CONTENT_ORIGIN: ${FRONTEND_URL} VITE_INDEEHUB_API_URL: /api @@ -45,6 +46,8 @@ services: build: context: ./backend dockerfile: Dockerfile + args: + CACHEBUST: "2" restart: unless-stopped environment: # ── Core ───────────────────────────────────────────── @@ -175,6 +178,8 @@ services: build: context: ./backend dockerfile: Dockerfile.ffmpeg + args: + CACHEBUST: "2" restart: unless-stopped environment: ENVIRONMENT: production