This commit is contained in:
2026-06-15 17:46:45 +08:00
parent 2b779d0423
commit c33488d95c
3 changed files with 56 additions and 74 deletions
+11 -27
View File
@@ -1,10 +1,12 @@
# =============================================================================
# MinerU ROCm Docker Compose 配置
# 原生 Linux + AMD GPU 环境
#
# 架构:Gradio / API → nginx (8000) → worker0 (8001) / worker1 (8002)
# =============================================================================
services:
# --- WebUI 前端(纯前端,不本地处理,通过 Router → Worker 处理)---
# --- WebUI 前端(纯前端,通过 nginx 分发到 worker)---
gradio:
image: mineru-rocm:7.2.1
profiles: ["gradio"]
@@ -16,7 +18,7 @@ services:
- "10002:7860"
environment:
- GRADIO_SERVER_NAME=0.0.0.0
- MINERU_API_BASE=http://mineru-router:8000
- MINERU_API_BASE=http://mineru-nginx:8000
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
@@ -30,9 +32,9 @@ services:
"/opt/mineru_venv/bin/python", "/opt/scripts/gradio_client.py",
]
depends_on:
- router
- nginx
# --- 双卡 Worker(GPU 算力,无 profile,始终可用)---
# --- 双卡 Worker(GPU 算力)---
worker0:
image: mineru-rocm:7.2.1
build:
@@ -94,32 +96,14 @@ services:
- ./scripts:/opt/scripts:ro
command: ["mineru-api", "--host", "0.0.0.0", "--port", "8002", "--allow-public-http-client"]
router:
image: mineru-rocm:7.2.1
container_name: mineru-router
stdin_open: true
tty: true
ipc: host
# --- Nginx 负载均衡(替换有 Bug 的 mineru-router)---
nginx:
image: nginx:alpine
container_name: mineru-nginx
ports:
- "8000:8000"
environment:
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
- HF_HUB_CACHE=${HF_HUB_CACHE:-/opt/models/huggingface}
- MODELSCOPE_CACHE=${MODELSCOPE_CACHE:-/opt/models/modelscope}
volumes:
- ${INPUT_DIR:-./data/input}:/data/input:ro
- ${OUTPUT_DIR:-./data/output}:/data/output
- ${MODEL_DIR:-./data/models}:/opt/models
- ./scripts:/opt/scripts:ro
command:
[
"mineru-router",
"--api-urls",
"http://mineru-worker0:8001,http://mineru-worker1:8002",
"--host", "0.0.0.0",
"--port", "8000",
"--allow-public-http-client",
]
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- worker0
- worker1