- 更新yolo_detect的模型权重文件 - 移除Python依赖安装中的清华源加速配置 - 修改Dockerfile中删除文件的注释描述 - 重构README文档,简化使用教程内容 - 更新Docker构建和启动命令格式 - 添加GIT LFS相关提示信息 - 移除重复的持久化配置说明
30 lines
774 B
Docker
30 lines
774 B
Docker
FROM python:3.11
|
|
|
|
# 安装系统依赖并清理缓存
|
|
RUN apt-get update && apt-get install -y \
|
|
libgl1 \
|
|
libglib2.0-0 \
|
|
libsm6 \
|
|
libxrender1 \
|
|
libxext6 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 设置工作目录
|
|
WORKDIR /code
|
|
|
|
# 复制并安装 Python 依赖
|
|
COPY requirements.txt /code/requirements.txt
|
|
|
|
# 安装 Python 依赖
|
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple \
|
|
&& pip install --no-cache-dir --upgrade torch torchvision --index-url https://download.pytorch.org/whl/cu130
|
|
|
|
# 复制应用代码
|
|
COPY ./app /code/app
|
|
|
|
# 删除核心文件,减小体积
|
|
RUN rm -rf /code/app/core
|
|
|
|
# 暴露端口并启动应用
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
|