Skip to content

Commit 59f8a9d

Browse files
committed
chore(docker): 优化镜像体积 #428
- 移除未使用的 langchain-huggingface 和 mineru[core] 依赖 - 使用 pytorch-cpu 镜像源替代默认 PyPI(docling 需要)
1 parent 739a778 commit 59f8a9d

File tree

3 files changed

+2490
-5416
lines changed

3 files changed

+2490
-5416
lines changed

docker/api.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ENV HTTP_PROXY=$HTTP_PROXY \
5454

5555
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
5656
RUN --mount=type=cache,target=/root/.cache/uv \
57-
uv sync --no-dev --frozen --index-url https://pypi.tuna.tsinghua.edu.cn/simple
57+
uv sync --no-dev --frozen
5858

5959
# 激活虚拟环境并添加到PATH
6060
ENV PATH="/app/.venv/bin:$PATH"

pyproject.toml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "yuxi-know"
33
version = "0.4.3.dev"
44
description = "基于大模型的智能知识库与知识图谱智能体开发平台,融合了 RAG 技术与知识图谱技术,基于 LangGraph v1 + Vue.js + FastAPI + LightRAG 架构构建"
55
readme = "README.md"
6-
requires-python = ">=3.11"
6+
requires-python = ">=3.12,<3.14"
77
dependencies = [
88
"asyncpg>=0.30.0",
99
"aiosqlite>=0.20.0",
@@ -16,7 +16,6 @@ dependencies = [
1616
"fastapi>=0.121",
1717
"langchain-community>=0.4",
1818
"langchain-deepseek>=1.0",
19-
"langchain-huggingface>=1.0.1",
2019
"langchain-mcp-adapters>=0.1.9",
2120
"langchain-openai>=1.0.2",
2221
"langchain-tavily>=0.2.13",
@@ -49,7 +48,6 @@ dependencies = [
4948
"tqdm>=4.66.4",
5049
"rich>=13.7.1",
5150
"typer>=0.16.0",
52-
"mineru[core]>=2.6",
5351
"tabulate>=0.9.0",
5452
"minio>=7.2.7",
5553
"Pillow>=10.5.0",
@@ -63,7 +61,10 @@ dependencies = [
6361
"chardet>=5.0.0",
6462
"deepagents>=0.2.5",
6563
"json-repair>=0.54.0",
64+
"torch>=2.8.0",
65+
"torchvision==0.23",
6666
"docling>=2.68.0",
67+
"loguru>=0.7.3",
6768
]
6869
[tool.ruff]
6970
line-length = 120 # 代码最大行宽
@@ -74,6 +75,24 @@ lint.select = [ # 选择的规则
7475
"UP",
7576
]
7677

78+
[tool.uv]
79+
80+
[[tool.uv.index]]
81+
name = "tsinghua"
82+
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
83+
default = true
84+
85+
86+
[[tool.uv.index]]
87+
name = "pytorch-cpu"
88+
url = "https://download.pytorch.org/whl/cpu"
89+
explicit = true
90+
91+
[tool.uv.sources]
92+
torch = { index = "pytorch-cpu" }
93+
torchvision = { index = "pytorch-cpu" }
94+
95+
7796
[tool.pytest.ini_options]
7897
addopts = "-v --tb=short"
7998
testpaths = ["test"]

0 commit comments

Comments
 (0)