From 6f4e0295377812b47d8d7dce4dbf67766a082ba5 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 14 Oct 2022 10:28:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?revert:=20=E8=BF=98=E5=8E=9F=20dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 26 +++++++++++++------------- package.json | 1 - 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index b54bf8999..e8ec915ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,23 @@ -FROM node:14.16 as stage-build -ARG TARGETARCH -ARG VERSION -ENV VERSION=$VERSION +FROM node:10 as stage-build ARG NPM_REGISTRY="https://registry.npmmirror.com" ENV NPM_REGISTY=$NPM_REGISTRY +ARG SASS_BINARY_SITE="https://npmmirror.com/mirrors/node-sass" +ENV SASS_BINARY_SITE=$SASS_BINARY_SITE WORKDIR /data -RUN set -ex \ - && npm config set registry ${NPM_REGISTRY} \ - && yarn config set registry ${NPM_REGISTRY} \ - && yarn config set cache-folder /root/.cache/yarn/lina +RUN npm config set sass_binary_site=${SASS_BINARY_SITE} +RUN npm config set registry ${NPM_REGISTRY} +RUN yarn config set registry ${NPM_REGISTRY} +COPY package.json yarn.lock /data/ +RUN yarn install +RUN npm rebuild node-sass +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 +RUN cd utils && bash -xieu build.sh build FROM nginx:alpine -COPY --from=stage-build /data/lina /opt/lina +COPY --from=stage-build /data/release/lina /opt/lina COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/package.json b/package.json index 015471211..755fe769a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "scripts": { "dev": "vue-cli-service serve", "serve": "vue-cli-service serve", - "build": "vue-cli-service build --mode staging", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", From 06fd007c62d3afa8be68d98ab4692bd1749564f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 14 Oct 2022 10:39:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Revert=20"revert:=20=E8=BF=98=E5=8E=9F=20do?= =?UTF-8?q?ckerfile"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6f4e0295377812b47d8d7dce4dbf67766a082ba5. --- Dockerfile | 26 +++++++++++++------------- package.json | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index e8ec915ec..b54bf8999 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,23 @@ -FROM node:10 as stage-build +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 -ARG SASS_BINARY_SITE="https://npmmirror.com/mirrors/node-sass" -ENV SASS_BINARY_SITE=$SASS_BINARY_SITE WORKDIR /data -RUN npm config set sass_binary_site=${SASS_BINARY_SITE} -RUN npm config set registry ${NPM_REGISTRY} -RUN yarn config set registry ${NPM_REGISTRY} -COPY package.json yarn.lock /data/ -RUN yarn install -RUN npm rebuild node-sass +RUN set -ex \ + && npm config set registry ${NPM_REGISTRY} \ + && yarn config set registry ${NPM_REGISTRY} \ + && yarn config set cache-folder /root/.cache/yarn/lina -ARG VERSION -ENV VERSION=$VERSION ADD . /data -RUN cd utils && bash -xieu build.sh build +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 -COPY --from=stage-build /data/release/lina /opt/lina +COPY --from=stage-build /data/lina /opt/lina COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/package.json b/package.json index 755fe769a..015471211 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "dev": "vue-cli-service serve", "serve": "vue-cli-service serve", + "build": "vue-cli-service build --mode staging", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", From 4aefb6779f18cb1b742e3f4f2f5595fe87279898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Fri, 14 Oct 2022 10:40:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=9E=84=E5=BB=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 015471211..8501248cf 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "dev": "vue-cli-service serve", "serve": "vue-cli-service serve", - "build": "vue-cli-service build --mode staging", + "build": "vue-cli-service build", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview",