国内源

This commit is contained in:
jeremygan2021
2026-01-09 23:41:12 +08:00
parent 1899ca0b9d
commit b393997b0d

View File

@@ -1,9 +1,12 @@
# 使用官方 Python 3.9 slim 镜像作为基础镜像
FROM python:3.9-slim
# 使用国内镜像源DaoCloud 公益镜像作为基础镜像
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.9-slim
# 设置工作目录
WORKDIR /app
# 设置 pip 国内镜像源(清华源)
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 设置环境变量
# 防止 Python 生成 .pyc 文件
ENV PYTHONDONTWRITEBYTECODE=1