chore(docker): 优化api镜像构建安装流程
This commit is contained in:
parent
4cc52360b6
commit
6a2bf4f0f2
@ -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/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 && \
|
sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \
|
||||||
# 安装系统依赖
|
# 清理apt缓存并更新,避免空间不足问题
|
||||||
apt-get update && apt-get install -y --no-install-recommends \
|
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 \
|
python3-dev \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
libsm6 \
|
libsm6 \
|
||||||
libxext6 \
|
libxext6 \
|
||||||
curl \
|
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
|
COPY ../pyproject.toml /app/pyproject.toml
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user