update dockerfile

This commit is contained in:
2025-09-30 16:55:42 +08:00
parent e0f2b8bf35
commit bdf33e28e6
3 changed files with 15 additions and 44 deletions

View File

@@ -1,11 +1,10 @@
# 使用支持CUDA的PyTorch基础镜像
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
FROM python:3.9-slim
# 设置工作目录
WORKDIR /app
# 设置pip镜像源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 安装系统依赖
RUN apt-get update && apt-get install -y \
@@ -14,14 +13,19 @@ RUN apt-get update && apt-get install -y \
libxext6 \
libxrender-dev \
libgomp1 \
libgl1 \
libglib2.0-dev \
curl \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# 复制requirements.txt
COPY requirements.txt .
# 安装Python依赖
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple
# 复制应用代码
COPY app/ /app/app/

View File

@@ -4,7 +4,7 @@ opencv-python==4.8.0.76
numpy==1.25.2
pydantic==2.3.0
python-multipart==0.0.6
minio==7.1.15
minio>=7.2,<8
torch>=1.7.0
torchvision>=0.8.1
ultralytics>=8.0.0