fix(snapshot): Dockerfile 安装 postgresql-client-16 匹配目标 PG 版本

bookworm 默认 postgresql-client 是 15,目标数据库是 PG16
添加 PGDG 源安装 postgresql-client-16

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-23 23:20:45 -08:00
parent 470dc1ccd0
commit 9a88fb473a
1 changed files with 8 additions and 5 deletions

View File

@ -17,12 +17,15 @@ FROM node:20-slim AS production
WORKDIR /app WORKDIR /app
# 安装系统工具: openssl, curl (健康检查), postgresql-client (pg_basebackup) # 安装系统工具 + PostgreSQL 16 客户端 (匹配目标数据库版本)
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \ openssl curl ca-certificates gnupg lsb-release \
curl \ && echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \
ca-certificates \ > /etc/apt/sources.list.d/pgdg.list \
postgresql-client \ && curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/pgdg.gpg \
&& apt-get update && apt-get install -y --no-install-recommends \
postgresql-client-16 gzip \
&& apt-get purge -y gnupg lsb-release && apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# 安装 MinIO 客户端 (mc) # 安装 MinIO 客户端 (mc)