Files
check_in/Dockerfile
jeremygan2021 b393997b0d 国内源
2026-01-09 23:41:12 +08:00

30 lines
675 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用国内镜像源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
# 确保 Python 输出不被缓冲
ENV PYTHONUNBUFFERED=1
# 复制依赖文件
COPY requirements.txt .
# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt
# 复制项目文件
COPY . .
# 暴露端口
EXPOSE 8800
# 启动命令
CMD ["python", "main.py", "--port", "8800"]