From c3d943903042d9d68c27a6ce6f58fb9ddccdf300 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Tue, 9 May 2023 23:38:39 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20admin/Dockerfile=20=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E5=8C=85=E7=AE=A1=E7=90=86=E5=99=A8=E7=BC=93=E5=AD=98=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/yudao-ui-admin/Dockerfile b/yudao-ui-admin/Dockerfile index 382c3eb41..6c74b4eaa 100644 --- a/yudao-ui-admin/Dockerfile +++ b/yudao-ui-admin/Dockerfile @@ -1,11 +1,10 @@ -FROM node:16-alpine as DIST +FROM node:16-alpine as build-stage WORKDIR /admim -COPY ./package.json . -COPY ./yarn.lock . -COPY ./.npmrc . -RUN yarn install +COPY .npmrc package.json yarn.lock ./ +RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \ + yarn install COPY . . ARG NODE_ENV="" @@ -17,6 +16,6 @@ FROM nginx:alpine ENV TZ=Asia/Shanghai COPY ./nginx.conf /etc/nginx/conf.d/default.conf -COPY --from=DIST /admim/dist /usr/share/nginx/html +COPY --from=build-stage /admim/dist /usr/share/nginx/html EXPOSE 80