docker(dashboard): upgrade base image packages in both build and runtime stages

This commit is contained in:
Haitao Pan 2025-12-06 19:19:19 +08:00
parent 7e7b21f053
commit 1787083d3e

View File

@ -14,16 +14,17 @@ WORKDIR /app/dashboard
ENV NEXT_TELEMETRY_DISABLED=1 \
NEXT_PRIVATE_TURBOPACK=1
# ---------------------------
# 基础镜像升级到最新
# ---------------------------
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/* \
&& corepack enable \
&& corepack prepare yarn@4.12.0 --activate
# Copy monorepo 内容
COPY . .
# 安装完整依赖(包含 devDependencies
RUN find . -name "package-lock.json" -delete
RUN yarn install --immutable
RUN yarn next build
@ -42,13 +43,13 @@ ENV NODE_ENV=production \
# ---------------------------
# 安装 tini修复子进程 + 更快退出)
# 基础镜像升级到最新
# ---------------------------
RUN apt-get update \
&& apt-get install -y --no-install-recommends tini ca-certificates \
&& apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/usr/bin/tini", "--"]
# ---------------------------
# 导入 standalone 的运行产物
# ---------------------------
@ -68,4 +69,6 @@ COPY --from=builder /app/dashboard/public ./public
EXPOSE 3000
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["node", "server.js"]