Dockerfile 536 Bytes
FROM python:3.11-slim

# 兼容旧 CPU 的环境设置(OpenBLAS 使用兼容模式)
ENV OPENBLAS_CORETYPE=Haswell

# PyPI 镜像加速(清华源)
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple

WORKDIR /app

COPY requirements.txt .
# numpy 1.24.4 使用 manylinux2014 wheel,兼容旧 x86-64 CPU
RUN pip install --no-cache-dir numpy==1.24.4
RUN pip install --no-cache-dir -r requirements.txt
RUN python -c "import numpy; print('numpy version:', numpy.__version__)"

COPY . .

EXPOSE 9500

CMD ["python", "main.py"]