mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-12 12:01:58 +00:00
perf: 优化构建
This commit is contained in:
parent
e55272180d
commit
1029d0cfa1
@ -1,23 +1,21 @@
|
|||||||
FROM node:14.16 as stage-build
|
FROM node:14.16 as stage-build
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
||||||
ENV NPM_REGISTY=$NPM_REGISTRY
|
|
||||||
|
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& npm config set registry ${NPM_REGISTRY} \
|
&& npm config set registry ${NPM_REGISTRY} \
|
||||||
&& yarn config set registry ${NPM_REGISTRY} \
|
&& yarn config set registry ${NPM_REGISTRY}
|
||||||
&& yarn config set cache-folder /root/.cache/yarn/lina
|
|
||||||
|
|
||||||
ADD package.json yarn.lock /data
|
ADD package.json yarn.lock /data
|
||||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=lina \
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ENV VERSION=$VERSION
|
ENV VERSION=$VERSION
|
||||||
ADD . /data
|
ADD . /data
|
||||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=lina \
|
||||||
sed -i "s@Version <strong>.*</strong>@Version <strong>${VERSION}</strong>@g" src/layout/components/Footer/index.vue \
|
sed -i "s@Version <strong>.*</strong>@Version <strong>${VERSION}</strong>@g" src/layout/components/Footer/index.vue \
|
||||||
&& yarn build
|
&& yarn build
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user