chore(docker): 优化镜像体积 #428

- 移除未使用的 langchain-huggingface 和 mineru[core] 依赖
  - 使用 pytorch-cpu 镜像源替代默认 PyPI(docling 需要)
This commit is contained in:
Wenjie Zhang 2026-01-16 15:43:41 +08:00
parent 739a7785e9
commit 59f8a9da73
3 changed files with 2431 additions and 5357 deletions

View File

@ -54,7 +54,7 @@ ENV HTTP_PROXY=$HTTP_PROXY \
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-dev --frozen --index-url https://pypi.tuna.tsinghua.edu.cn/simple
uv sync --no-dev --frozen
# 激活虚拟环境并添加到PATH
ENV PATH="/app/.venv/bin:$PATH"

View File

@ -3,7 +3,7 @@ name = "yuxi-know"
version = "0.4.3.dev"
description = "基于大模型的智能知识库与知识图谱智能体开发平台,融合了 RAG 技术与知识图谱技术,基于 LangGraph v1 + Vue.js + FastAPI + LightRAG 架构构建"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.12,<3.14"
dependencies = [
"asyncpg>=0.30.0",
"aiosqlite>=0.20.0",
@ -16,7 +16,6 @@ dependencies = [
"fastapi>=0.121",
"langchain-community>=0.4",
"langchain-deepseek>=1.0",
"langchain-huggingface>=1.0.1",
"langchain-mcp-adapters>=0.1.9",
"langchain-openai>=1.0.2",
"langchain-tavily>=0.2.13",
@ -49,7 +48,6 @@ dependencies = [
"tqdm>=4.66.4",
"rich>=13.7.1",
"typer>=0.16.0",
"mineru[core]>=2.6",
"tabulate>=0.9.0",
"minio>=7.2.7",
"Pillow>=10.5.0",
@ -63,7 +61,10 @@ dependencies = [
"chardet>=5.0.0",
"deepagents>=0.2.5",
"json-repair>=0.54.0",
"torch>=2.8.0",
"torchvision==0.23",
"docling>=2.68.0",
"loguru>=0.7.3",
]
[tool.ruff]
line-length = 120 # 代码最大行宽
@ -74,6 +75,24 @@ lint.select = [ # 选择的规则
"UP",
]
[tool.uv]
[[tool.uv.index]]
name = "tsinghua"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
default = true
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cpu" }
torchvision = { index = "pytorch-cpu" }
[tool.pytest.ini_options]
addopts = "-v --tb=short"
testpaths = ["test"]

7761
uv.lock

File diff suppressed because it is too large Load Diff