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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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 . .
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user