From f390e23ba7f2507be22d62322114309485e88b5c Mon Sep 17 00:00:00 2001 From: Wang Zhuoxuan Date: Fri, 17 Apr 2026 16:17:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Dockerfile=20=E5=85=BC=E5=AE=B9=20Debian?= =?UTF-8?q?=20=E5=9F=BA=E7=A1=80=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - addgroup/adduser → groupadd/useradd (Alpine → Debian) - 安装 curl 用于健康检查 --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 555f01c..9e8be1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,9 +23,12 @@ RUN bun run build FROM oven/bun:1.3 AS release WORKDIR /app -# 创建非 root 用户 -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 bun +# 创建非 root 用户(Debian 兼容命令) +RUN groupadd --system --gid 1001 nodejs && \ + useradd --system --uid 1001 --gid nodejs --no-create-home --shell /usr/sbin/nologin bun + +# 安装 curl(用于健康检查) +RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* # 复制生产依赖和构建产物 COPY --from=install /app/node_modules ./node_modules