1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-04-14 02:09:56 +08:00

Merge pull request #92 from lir0115/perf/image-cache

This commit is contained in:
公众号:Rong姐姐好可爱
2023-11-21 09:12:43 +08:00
committed by GitHub

View File

@@ -9,13 +9,18 @@
FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:18.18.0-alpine AS build_base
ARG CONTAINER_BUILD
## 设置环境变量支持容器构建时使用layer缓存参考https://pnpm.io/zh/docker
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
WORKDIR /apps
COPY . .
RUN echo $CONTAINER_BUILD;
## 基于容器自动构建
RUN if [ "$CONTAINER_BUILD" = "true" ]; then \
RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "$CONTAINER_BUILD" = "true" ]; then \
sh ./scripts/ci && pnpm build; \
fi;