chore: psycopg 改用 binary extra,精简 Dockerfile 的 apt 依赖
psycopg[binary] 替代并列声明的 psycopg + psycopg-binary。上游的 binary extra 是 psycopg-binary==<同版本> 的精确 pin,而原来两条各自 带范围,没有东西保证它们同步——单独升级其中一个就可能凑出上游没测过 的组合。解析结果不变,requirements.txt 只多了 extra 自带的 implementation_name != 'pypy' 标记。 apt 依赖从 10 个降到 4 个: - curl / unzip / openssl:全仓库零引用。解压走 Python zipfile, 健康检查走 xmlrpc,openssl 装的是 CLI 而 Python 要的是 libssl - libpq5:psycopg_binary.libs 自带 libpq.so.5.18,容器内实测 psycopg.pq.__impl__ == binary - libjpeg62-turbo:pillow.libs 自带 libjpeg.so.62 - zlib1g:base 镜像的 CPython 已经带着 保留 ca-certificates(smtplib 走 TLS 时读系统信任库,不是 certifi)、 clang-format(submission/utils.py 调用)、passwd(entrypoint 建账号)、 supervisor。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -19,17 +19,13 @@ if [ -f /etc/apt/sources.list ]; then
|
||||
sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g; s|security.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
||||
fi
|
||||
apt-get update
|
||||
# libpq / libjpeg 都在 wheel 里自带(psycopg_binary.libs、pillow.libs),不装系统版。
|
||||
# zlib 由 base 镜像的 CPython 带着,Pillow 用的是它。
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
clang-format \
|
||||
curl \
|
||||
libjpeg62-turbo \
|
||||
libpq5 \
|
||||
openssl \
|
||||
passwd \
|
||||
supervisor \
|
||||
unzip \
|
||||
zlib1g
|
||||
supervisor
|
||||
pip install -r /app/deploy/requirements.txt
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
EOS
|
||||
|
||||
Reference in New Issue
Block a user