Skip to content

Commit

Permalink
Merge pull request #122 from lir0115/perf/docker-build
Browse files Browse the repository at this point in the history
  • Loading branch information
公众号:Rong姐姐好可爱 authored Nov 21, 2023
2 parents ab07acb + 8c77d64 commit c9420b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,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;

Expand Down

0 comments on commit c9420b5

Please sign in to comment.