From b8ce7c0d37dfdc44dd8f58457ea1f57f0d759901 Mon Sep 17 00:00:00 2001 From: cryptooda Date: Sat, 5 Jul 2025 15:52:30 +0700 Subject: [PATCH] webui no cache build --- src/Managing.WebApp/Dockerfile-web-ui-dev | 9 ++++++++- src/Managing.WebApp/captain-definition | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/Managing.WebApp/captain-definition diff --git a/src/Managing.WebApp/Dockerfile-web-ui-dev b/src/Managing.WebApp/Dockerfile-web-ui-dev index 5fd37b7..5bc5bbd 100644 --- a/src/Managing.WebApp/Dockerfile-web-ui-dev +++ b/src/Managing.WebApp/Dockerfile-web-ui-dev @@ -1,6 +1,9 @@ # Use an official Node.js image as the base FROM node:22.14.0-alpine +# Add build argument for cache busting +ARG CACHEBUST=1 + # Set the working directory in the container WORKDIR /app @@ -18,8 +21,12 @@ RUN apk update && apk add --no-cache git python3 make g++ # COPY package*.json ./ COPY /src/Managing.WebApp/package.json ./ +# Use cache busting argument to force cache invalidation +RUN echo "Cache bust: $CACHEBUST" + # Install dependencies with the --legacy-peer-deps flag to bypass peer dependency conflicts -RUN npm install --legacy-peer-deps --loglevel verbose +# Add --no-cache flag to prevent npm cache usage +RUN npm install --legacy-peer-deps --loglevel verbose --no-cache RUN npm install -g tailwindcss postcss autoprefixer @tailwindcss/typography # Copy the rest of the app's source code to the container diff --git a/src/Managing.WebApp/captain-definition b/src/Managing.WebApp/captain-definition new file mode 100644 index 0000000..51c116d --- /dev/null +++ b/src/Managing.WebApp/captain-definition @@ -0,0 +1,7 @@ +{ + "schemaVersion": 2, + "dockerfilePath": "Dockerfile-web-ui-dev", + "buildArgs": { + "CACHEBUST": "{{BUILD_NUMBER}}" + } +} \ No newline at end of file