Skip to content

Commit

Permalink
fix: 修复Dockerfile构建异常,增加git国内下载
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdapl committed Sep 24, 2024
1 parent 03023a3 commit 0f686f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ ARG NEED_PROXY=false
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

## corepack 环境变量
## corepack 环境变量,在CI脚本中直接设置
#ENV COREPACK_NPM_REGISTRY=https://mirrors.tencent.com/npm/

WORKDIR /apps
COPY . .

RUN ls
## 安装git,博客编译需要使用git信息
RUN apk add --no-cache git --repository http://mirrors.aliyun.com/alpine/v3.14/main/

## 基于容器自动构建
RUN --mount=type=cache,id=pnpm,target=/pnpm/store sh ./scripts/ci && if [ "$NEED_PROXY" = "false" ]; \
Expand Down Expand Up @@ -51,5 +52,5 @@ LABEL "repo.name"=$APP_NAME "repo.version"=$APP_VERSION \
LABEL "git.hash"="$GIT_HASH"

# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 注意:--from参数
COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/
COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
COPY --from=build_base /apps/nginx.conf /etc/nginx/
1 change: 1 addition & 0 deletions scripts/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
['HOME_PAGE', pkg.authorInfo.homePage],
['GIT_HASH', gitHash],
],
memory:20000,
push: true,
delete: true,
logger: true,
Expand Down

0 comments on commit 0f686f3

Please sign in to comment.