chore(docker): 优化镜像体积 #428
- 移除未使用的 langchain-huggingface 和 mineru[core] 依赖 - 使用 pytorch-cpu 镜像源替代默认 PyPI(docling 需要)
This commit is contained in:
parent
739a7785e9
commit
59f8a9da73
@ -54,7 +54,7 @@ ENV HTTP_PROXY=$HTTP_PROXY \
|
|||||||
|
|
||||||
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
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
|
# 激活虚拟环境并添加到PATH
|
||||||
ENV PATH="/app/.venv/bin:$PATH"
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|||||||
@ -3,7 +3,7 @@ name = "yuxi-know"
|
|||||||
version = "0.4.3.dev"
|
version = "0.4.3.dev"
|
||||||
description = "基于大模型的智能知识库与知识图谱智能体开发平台,融合了 RAG 技术与知识图谱技术,基于 LangGraph v1 + Vue.js + FastAPI + LightRAG 架构构建"
|
description = "基于大模型的智能知识库与知识图谱智能体开发平台,融合了 RAG 技术与知识图谱技术,基于 LangGraph v1 + Vue.js + FastAPI + LightRAG 架构构建"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.12,<3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"asyncpg>=0.30.0",
|
"asyncpg>=0.30.0",
|
||||||
"aiosqlite>=0.20.0",
|
"aiosqlite>=0.20.0",
|
||||||
@ -16,7 +16,6 @@ dependencies = [
|
|||||||
"fastapi>=0.121",
|
"fastapi>=0.121",
|
||||||
"langchain-community>=0.4",
|
"langchain-community>=0.4",
|
||||||
"langchain-deepseek>=1.0",
|
"langchain-deepseek>=1.0",
|
||||||
"langchain-huggingface>=1.0.1",
|
|
||||||
"langchain-mcp-adapters>=0.1.9",
|
"langchain-mcp-adapters>=0.1.9",
|
||||||
"langchain-openai>=1.0.2",
|
"langchain-openai>=1.0.2",
|
||||||
"langchain-tavily>=0.2.13",
|
"langchain-tavily>=0.2.13",
|
||||||
@ -49,7 +48,6 @@ dependencies = [
|
|||||||
"tqdm>=4.66.4",
|
"tqdm>=4.66.4",
|
||||||
"rich>=13.7.1",
|
"rich>=13.7.1",
|
||||||
"typer>=0.16.0",
|
"typer>=0.16.0",
|
||||||
"mineru[core]>=2.6",
|
|
||||||
"tabulate>=0.9.0",
|
"tabulate>=0.9.0",
|
||||||
"minio>=7.2.7",
|
"minio>=7.2.7",
|
||||||
"Pillow>=10.5.0",
|
"Pillow>=10.5.0",
|
||||||
@ -63,7 +61,10 @@ dependencies = [
|
|||||||
"chardet>=5.0.0",
|
"chardet>=5.0.0",
|
||||||
"deepagents>=0.2.5",
|
"deepagents>=0.2.5",
|
||||||
"json-repair>=0.54.0",
|
"json-repair>=0.54.0",
|
||||||
|
"torch>=2.8.0",
|
||||||
|
"torchvision==0.23",
|
||||||
"docling>=2.68.0",
|
"docling>=2.68.0",
|
||||||
|
"loguru>=0.7.3",
|
||||||
]
|
]
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 120 # 代码最大行宽
|
line-length = 120 # 代码最大行宽
|
||||||
@ -74,6 +75,24 @@ lint.select = [ # 选择的规则
|
|||||||
"UP",
|
"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]
|
[tool.pytest.ini_options]
|
||||||
addopts = "-v --tb=short"
|
addopts = "-v --tb=short"
|
||||||
testpaths = ["test"]
|
testpaths = ["test"]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user