mdbs/Dockerfile

24 lines
541 B
Docker
Raw Permalink Normal View History

# 使用官方Python 3.11 slim镜像
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 安装系统依赖(包含自动配置源)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
python3-dev \
libopenblas-dev && \
rm -rf /var/lib/apt/lists/*
# 复制依赖文件
COPY requirements.txt .
# 使用清华pip源安装Python依赖
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 复制应用代码
COPY . .
CMD ["python", "anchor.py"]