update
This commit is contained in:
+6
-14
@@ -7,24 +7,16 @@ WORKDIR /app
|
||||
# 设置环境变量
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PIP_NO_CACHE_DIR=1
|
||||
ENV PIP_INDEX_URL=https://pypi.mirrors.ustc.edu.cn/simple/
|
||||
|
||||
# 配置中科大镜像源
|
||||
# 配置 apt 镜像源
|
||||
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
|
||||
sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources
|
||||
|
||||
# 安装系统依赖
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
clang-format \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制项目文件
|
||||
# 复制依赖文件
|
||||
COPY requirements.txt ./
|
||||
|
||||
# 安装依赖(使用中科大 PyPI 镜像)
|
||||
RUN pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
|
||||
RUN pip install -r requirements.txt
|
||||
# clang-format 使用 PyPI 的二进制 wheel,避免 apt 拉取 LLVM 全家桶;
|
||||
# 所有依赖都有预编译 wheel,不需要 gcc
|
||||
RUN pip install -r requirements.txt clang-format
|
||||
|
||||
# 复制应用代码
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user