File tree Expand file tree Collapse file tree 4 files changed +190
-250
lines changed
Expand file tree Collapse file tree 4 files changed +190
-250
lines changed Original file line number Diff line number Diff line change 66# CONTAINER_BUILD: 采用容器构建
77#
88
9- FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:18.18 .0-alpine AS build_base
9+ FROM registry.cn-hangzhou.aliyuncs.com/142vip/node:20.17 .0-alpine AS build_base
1010
11- ARG CONTAINER_BUILD
11+ # 是否
12+ ARG NEED_PROXY=false
1213
1314# # 设置环境变量,支持容器构建时使用layer缓存,参考:https://pnpm.io/zh/docker
1415ENV PNPM_HOME="/pnpm"
1516ENV PATH="$PNPM_HOME:$PATH"
1617
18+ # # corepack 环境变量
19+ ENV COREPACK_NPM_REGISTRY=https://mirrors.tencent.com/npm/
20+
1721WORKDIR /apps
1822COPY . .
1923
24+ RUN ls
25+
2026# # 基于容器自动构建
21- RUN --mount=type=cache,id=pnpm,target=/pnpm/store if [ "$CONTAINER_BUILD" = "true" ]; then \
22- sh ./scripts/ci && pnpm build; \
27+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci && if [ "$NEED_PROXY" = "false" ]; \
28+ then \
29+ pnpm build; \
30+ else \
31+ pnpm build:proxy; \
2332 fi;
2433
34+
2535FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine
2636
2737
2838# # 自定义镜像的Label信息
2939ARG APP_NAME
3040ARG APP_VERSION
41+ ARG APP_DESCRIPTION
3142ARG AUTHOR
3243ARG EMAIL
33- ARG DESCRIPTION
34- ARG GIT_HASH
35- ARG GIT_MESSAGE
3644ARG HOME_PAGE
45+ ARG GIT_HASH
3746
3847# 作者信息 & 项目信息 & Git信息
3948LABEL "maintainer" ="$AUTHOR <$EMAIL>"
4049LABEL "repo.name" =$APP_NAME "repo.version" =$APP_VERSION \
41- "repo.homePage " ="$HOME_PAGE " "repo.description " ="$DESCRIPTION "
42- LABEL "git.hash" ="$GIT_HASH" "git.message" = "$GIT_MESSAGE"
50+ "repo.description " ="$DESCRIPTION " "repo.homePage " ="$HOME_PAGE "
51+ LABEL "git.hash" ="$GIT_HASH"
4352
4453# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 注意:--from参数
4554COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
Original file line number Diff line number Diff line change 2929 "devDependencies" : {
3030 "@142vip/fairy-cli" : " ^0.0.3-alpha.11" ,
3131 "@142vip/release-version" : " ^0.0.1-alpha.9" ,
32- "@142vip/utils" : " 0.0.1-alpha.2 " ,
32+ "@142vip/utils" : " ^ 0.0.1-alpha.4 " ,
3333 "@antfu/eslint-config" : " ^2.27.3" ,
3434 "@commitlint/cli" : " ^18.6.1" ,
3535 "@commitlint/config-conventional" : " ^18.6.3" ,
You can’t perform that action at this time.
0 commit comments