17 lines
508 B
Docker
17 lines
508 B
Docker
# docker build . --platform linux/amd64 --push -t leafdev.top/leaf/icp-api:v0.0.1
|
|
#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
|
|
|
|
# 移除 onnxruntime 并重新安装
|
|
RUN pip uninstall onnxruntime onnxruntime-gpu -y && pip install onnxruntime-gpu
|
|
|
|
# 拷贝剩下的文件
|
|
COPY . /app
|
|
|
|
#
|
|
CMD ["uvicorn", "main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"] |