perf: dockerfile proxy (#3067)

This commit is contained in:
Archer
2024-11-05 10:08:59 +08:00
committed by archer
parent fd49ad1342
commit 07b3a0a35d
2 changed files with 8 additions and 4 deletions

View File

@@ -16,4 +16,5 @@ weight: 811
5. 优化 - 全文检索语句,减少一轮查询。
6. 优化 - 修改 findLast 为 [...array].reverse().find适配旧版浏览器。
7. 优化 - Markdown 组件自动空格,避免分割 url 中的中文。
8. 修复 - BI 图表生成无法写入文件。
8. 修复 - Dockerfile pnpm install 支持代理。
9. 修复 - BI 图表生成无法写入文件。

View File

@@ -6,8 +6,6 @@ ARG proxy
RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache libc6-compat && npm install -g pnpm@9.4.0
# if proxy exists, set proxy
RUN [ -z "$proxy" ] || pnpm config set registry https://registry.npmmirror.com
# copy packages and one project
COPY pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
@@ -16,7 +14,12 @@ COPY ./projects/app/package.json ./projects/app/package.json
RUN [ -f pnpm-lock.yaml ] || (echo "Lockfile not found." && exit 1)
RUN pnpm i
# if proxy exists, set proxy
RUN if [ -z "$proxy" ]; then \
pnpm i; \
else \
pnpm i --registry=https://registry.npmmirror.com; \
fi
# --------- builder -----------
FROM node:20.14.0-alpine AS builder