icp-api/Dockerfile

17 lines
508 B
Docker
Raw Permalink Normal View History

2025-01-22 20:37:33 +00:00
# docker build . --platform linux/amd64 --push -t leafdev.top/leaf/icp-api:v0.0.1
2025-01-22 19:34:16 +00:00
#FROM python:3.12.7
FROM docker.io/pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir --upgrade -r requirements.txt
2025-01-22 20:37:33 +00:00
# 移除 onnxruntime 并重新安装
RUN pip uninstall onnxruntime onnxruntime-gpu -y && pip install onnxruntime-gpu
# 拷贝剩下的文件
2025-01-22 19:34:16 +00:00
COPY . /app
#
CMD ["uvicorn", "main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]