build(Dockerfile): 添加必要的系统工具并优化依赖安装

添加 tar 和 git 工具以支持更新功能和版本检查,同时保持 npm install 命令的简洁性
This commit is contained in:
hex2077 2026-01-07 23:16:42 +08:00
parent b640ea746b
commit ddc9533f21

View file

@ -6,6 +6,9 @@ FROM node:20-alpine
LABEL maintainer="AIClient2API Team"
LABEL description="Docker image for AIClient2API server"
# 安装必要的系统工具tar 用于更新功能git 用于版本检查)
RUN apk add --no-cache tar git
# 设置工作目录
WORKDIR /app
@ -15,7 +18,7 @@ COPY package*.json ./
# 安装依赖
# 使用--production标志只安装生产依赖减小镜像大小
# 使用--omit=dev来排除开发依赖
RUN npm install
RUN npm install
# 复制源代码
COPY . .