From 6a2bf4f0f296166743e8705632ed783eac3d7cae Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sun, 21 Sep 2025 14:30:55 +0800 Subject: [PATCH] =?UTF-8?q?chore(docker):=20=E4=BC=98=E5=8C=96api=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=9E=84=E5=BB=BA=E5=AE=89=E8=A3=85=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/api.Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docker/api.Dockerfile b/docker/api.Dockerfile index a793c0fb..2c7040b8 100644 --- a/docker/api.Dockerfile +++ b/docker/api.Dockerfile @@ -15,14 +15,20 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone & # 更换为阿里云镜像源加速下载 sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \ sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \ - # 安装系统依赖 - apt-get update && apt-get install -y --no-install-recommends \ + # 清理apt缓存并更新,避免空间不足问题 + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \ + apt-get update && \ + # 安装系统依赖,减少缓存占用 + apt-get install -y --no-install-recommends \ python3-dev \ ffmpeg \ libsm6 \ libxext6 \ curl \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + && apt-get autoremove -y && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/* # 复制项目配置文件 COPY ../pyproject.toml /app/pyproject.toml