From d31929eb33379b84d8d8c1de7feb4ccaded603e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com>
Date: Sat, 22 Oct 2022 23:31:12 +0800
Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Dockerfile | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index b54bf8999..2ad4c1be3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,5 @@
FROM node:14.16 as stage-build
ARG TARGETARCH
-ARG VERSION
-ENV VERSION=$VERSION
ARG NPM_REGISTRY="https://registry.npmmirror.com"
ENV NPM_REGISTY=$NPM_REGISTRY
@@ -12,10 +10,15 @@ RUN set -ex \
&& yarn config set registry ${NPM_REGISTRY} \
&& yarn config set cache-folder /root/.cache/yarn/lina
+ADD package.json yarn.lock /data
+RUN --mount=type=cache,target=/root/.cache/yarn \
+ yarn install
+
+ARG VERSION
+ENV VERSION=$VERSION
ADD . /data
RUN --mount=type=cache,target=/root/.cache/yarn \
sed -i "s@Version .*@Version ${VERSION}@g" src/layout/components/Footer/index.vue \
- && yarn install \
&& yarn build
FROM nginx:alpine