agent里init.sh只初始化配置
This commit is contained in:
@@ -8,6 +8,12 @@ WORKDIR /app
|
||||
# 想换回官方:docker compose build --build-arg NPM_REGISTRY=https://registry.npmjs.org/
|
||||
ARG NPM_REGISTRY=https://mirrors.cloud.tencent.com/npm/
|
||||
|
||||
# better-sqlite3 的预编译二进制默认从 GitHub Releases 拉,国内经常拉挂。
|
||||
# npm 会把 npm_config_ 开头的环境变量当配置项;prebuild-install 读到这个键后,
|
||||
# 下载地址变成它拼 /v<版本>/<文件名>,和 npmmirror 的 binary 镜像布局一致(Node 20 的
|
||||
# node-v115-linux-x64 在架),不再走源码编译,也就无需在 slim 镜像里装编译工具链。
|
||||
ENV npm_config_better_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/better-sqlite3
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm config set registry "$NPM_REGISTRY" \
|
||||
&& npm install --omit=dev --no-audit --no-fund
|
||||
|
||||
Reference in New Issue
Block a user