perf: admin/Dockerfile 挂载包管理器缓存目录

This commit is contained in:
dhb52 2023-05-09 23:38:39 +08:00
parent 97502c8b51
commit c3d9439030

View File

@ -1,11 +1,10 @@
FROM node:16-alpine as DIST FROM node:16-alpine as build-stage
WORKDIR /admim WORKDIR /admim
COPY ./package.json . COPY .npmrc package.json yarn.lock ./
COPY ./yarn.lock . RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \
COPY ./.npmrc . yarn install
RUN yarn install
COPY . . COPY . .
ARG NODE_ENV="" ARG NODE_ENV=""
@ -17,6 +16,6 @@ FROM nginx:alpine
ENV TZ=Asia/Shanghai ENV TZ=Asia/Shanghai
COPY ./nginx.conf /etc/nginx/conf.d/default.conf 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 EXPOSE 80