From f9f3651c7eae106f25218fca96f28e432249b162 Mon Sep 17 00:00:00 2001 From: goulustis Date: Thu, 12 Mar 2026 20:37:17 +0800 Subject: [PATCH] fix docker --- docker/Dockerfile.prod | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index 1658972..33f571c 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -17,11 +17,18 @@ FROM python:3.12-slim WORKDIR /app # Install system dependencies -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/*.list /etc/apt/sources.list && \ - apt-get update && apt-get install -y \ - postgresql-client \ - curl \ - && rm -rf /var/lib/apt/lists/* +RUN set -eux; \ + for source_file in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do \ + if [ -f "$source_file" ]; then \ + sed -i 's|deb.debian.org|mirrors.aliyun.com|g' "$source_file"; \ + sed -i 's|security.debian.org|mirrors.aliyun.com|g' "$source_file"; \ + fi; \ + done; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + postgresql-client \ + curl; \ + rm -rf /var/lib/apt/lists/* # Copy Python dependencies COPY pyproject.toml ./