Dockerfile
457 Bytes
FROM python:3.11-slim
# 兼容旧 CPU 的 NumPy 环境设置
ENV OPENBLAS_CORETYPE=Haswell
# PyPI 镜像加速(清华源)
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
WORKDIR /app
COPY requirements.txt .
# 强制先装 NumPy 1.x 避免 pip resolver 拉到 2.x (要求 x86-64-v2 指令集)
RUN pip install --no-cache-dir numpy==1.26.4
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 9500
CMD ["python", "main.py"]