From 31f9d6ab5dd1cc222f219d46a773667c72d8da1f Mon Sep 17 00:00:00 2001 From: cryptooda Date: Fri, 31 Jan 2025 19:33:22 +0700 Subject: [PATCH] CLear yarn package at build --- src/Managing.WebApp/Dockerfile-web-ui-dev | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Managing.WebApp/Dockerfile-web-ui-dev b/src/Managing.WebApp/Dockerfile-web-ui-dev index 4c875e5..9694bb4 100644 --- a/src/Managing.WebApp/Dockerfile-web-ui-dev +++ b/src/Managing.WebApp/Dockerfile-web-ui-dev @@ -17,10 +17,7 @@ WORKDIR /app # Copy the package.json and package-lock.json first to leverage Docker's cache COPY ./src/Managing.WebApp/package*.json ./ -#RUN npm config set registry http://registry.cnpmjs.org -# Install dependencies -#RUN npm ci --production --loglevel=verbose -#RUN npm i --omit=dev --loglevel=verbose + RUN apk update && apk add --no-cache git # Remove Yarn and Yarnpkg binaries if they exist RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg @@ -28,19 +25,22 @@ RUN rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg # Install Yarn globally RUN npm install -g yarn +# Clear Yarn cache +RUN yarn cache clean -#RUN npm i --max-old-space-size=12000 --loglevel=verbose -#RUN yarn add eslint-plugin-jsdoc@37.9.7 --dev --ignore-engines +# Use npm registry +RUN yarn config set registry https://registry.npmjs.org/ + +# Install dependencies RUN yarn install --verbose # Copy the application code COPY ./src/Managing.WebApp/ /app/ RUN ls -alh RUN ls -alh src/ -# Build the Vite application -#RUN npm run build -#RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build +# Build the Vite application +RUN node --max-old-space-size=8192 ./node_modules/.bin/vite build # Stage 2: Create the runtime image FROM nginx:alpine @@ -55,4 +55,4 @@ COPY --from=builder /app/dist /usr/share/nginx/html EXPOSE 80 # Start the Nginx server -CMD ["nginx", "-g", "daemon off;"] +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file