fix: add cache-bust build arg to force Docker rebuild on deploy
Portainer stack updates were serving stale cached Docker layers. Added CACHE_BUST ARG so each deploy can force a fresh build. Set CACHE_BUST env var in Portainer to current timestamp to trigger. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
8e9285cd50
commit
834be596ba
@@ -7,13 +7,18 @@ COPY frontend/package.json frontend/
|
|||||||
COPY server/package.json server/
|
COPY server/package.json server/
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Cache-bust arg — pass --build-arg CACHE_BUST=$(date +%s) to force rebuild
|
||||||
|
ARG CACHE_BUST=0
|
||||||
|
|
||||||
# Stage 2: Build frontend
|
# Stage 2: Build frontend
|
||||||
FROM deps AS build-fe
|
FROM deps AS build-fe
|
||||||
|
ARG CACHE_BUST
|
||||||
COPY frontend/ frontend/
|
COPY frontend/ frontend/
|
||||||
RUN pnpm --filter frontend build
|
RUN pnpm --filter frontend build
|
||||||
|
|
||||||
# Stage 3: Build server
|
# Stage 3: Build server
|
||||||
FROM deps AS build-be
|
FROM deps AS build-be
|
||||||
|
ARG CACHE_BUST
|
||||||
COPY server/ server/
|
COPY server/ server/
|
||||||
RUN pnpm --filter server build
|
RUN pnpm --filter server build
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
services:
|
services:
|
||||||
botfights:
|
botfights:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
CACHE_BUST: ${CACHE_BUST:-0}
|
||||||
container_name: botfights
|
container_name: botfights
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user