2026-06-03 15:39:09 +08:00
|
|
|
|
# =============================================================================
|
|
|
|
|
|
# MinerU ROCm Docker Compose 配置
|
|
|
|
|
|
# 原生 Linux + AMD GPU 环境
|
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
services:
|
2026-06-10 10:52:32 +08:00
|
|
|
|
# --- WebUI 前端 ---
|
|
|
|
|
|
gradio:
|
2026-06-03 15:39:09 +08:00
|
|
|
|
image: mineru-rocm:7.2.1
|
2026-06-10 10:52:32 +08:00
|
|
|
|
profiles: ["gradio"]
|
|
|
|
|
|
container_name: mineru-gradio
|
2026-06-03 15:39:09 +08:00
|
|
|
|
stdin_open: true
|
|
|
|
|
|
tty: true
|
2026-06-05 13:35:14 +08:00
|
|
|
|
ipc: host
|
2026-06-10 10:52:32 +08:00
|
|
|
|
ports:
|
|
|
|
|
|
- "10002:7860"
|
2026-06-03 15:39:09 +08:00
|
|
|
|
environment:
|
2026-06-10 14:35:37 +08:00
|
|
|
|
- GRADIO_SERVER_NAME=0.0.0.0
|
2026-06-03 15:39:09 +08:00
|
|
|
|
- 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
|
2026-06-10 15:14:00 +08:00
|
|
|
|
- ./scripts:/opt/scripts:ro
|
2026-06-10 10:52:32 +08:00
|
|
|
|
command:
|
|
|
|
|
|
[
|
|
|
|
|
|
"mineru-gradio",
|
|
|
|
|
|
"--server-name", "0.0.0.0",
|
|
|
|
|
|
"--server-port", "7860",
|
|
|
|
|
|
"--api-url", "http://mineru-router:8000",
|
|
|
|
|
|
]
|
|
|
|
|
|
depends_on:
|
|
|
|
|
|
- router
|
2026-06-09 17:49:59 +08:00
|
|
|
|
|
2026-06-10 10:52:32 +08:00
|
|
|
|
# --- 双卡 Worker(GPU 算力,无 profile,始终可用)---
|
|
|
|
|
|
worker0:
|
2026-06-09 17:49:59 +08:00
|
|
|
|
image: mineru-rocm:7.2.1
|
2026-06-10 10:55:41 +08:00
|
|
|
|
build:
|
|
|
|
|
|
context: .
|
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
|
network: host
|
|
|
|
|
|
args:
|
2026-06-10 14:50:40 +08:00
|
|
|
|
ARCH: ${ARCH:-gfx1201}
|
|
|
|
|
|
GIT_PROXY: ${GIT_PROXY:-}
|
2026-06-10 10:52:32 +08:00
|
|
|
|
container_name: mineru-worker0
|
2026-06-09 17:49:59 +08:00
|
|
|
|
stdin_open: true
|
|
|
|
|
|
tty: true
|
|
|
|
|
|
ipc: host
|
|
|
|
|
|
devices:
|
|
|
|
|
|
- /dev/kfd
|
|
|
|
|
|
- /dev/dri
|
|
|
|
|
|
security_opt:
|
|
|
|
|
|
- seccomp=unconfined
|
|
|
|
|
|
group_add:
|
|
|
|
|
|
- video
|
|
|
|
|
|
environment:
|
2026-06-10 10:52:32 +08:00
|
|
|
|
- HIP_VISIBLE_DEVICES=0
|
2026-06-09 17:49:59 +08:00
|
|
|
|
- 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
|
|
|
|
|
|
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
2026-06-10 15:14:00 +08:00
|
|
|
|
- ./scripts:/opt/scripts:ro
|
2026-06-11 11:37:52 +08:00
|
|
|
|
command: ["mineru-api", "--host", "0.0.0.0", "--port", "8001", "--allow-public-http-client"]
|
2026-06-09 17:49:59 +08:00
|
|
|
|
|
2026-06-10 10:52:32 +08:00
|
|
|
|
worker1:
|
2026-06-09 17:49:59 +08:00
|
|
|
|
image: mineru-rocm:7.2.1
|
2026-06-10 10:52:32 +08:00
|
|
|
|
container_name: mineru-worker1
|
2026-06-09 17:49:59 +08:00
|
|
|
|
stdin_open: true
|
|
|
|
|
|
tty: true
|
|
|
|
|
|
ipc: host
|
|
|
|
|
|
devices:
|
|
|
|
|
|
- /dev/kfd
|
|
|
|
|
|
- /dev/dri
|
|
|
|
|
|
security_opt:
|
|
|
|
|
|
- seccomp=unconfined
|
|
|
|
|
|
group_add:
|
|
|
|
|
|
- video
|
|
|
|
|
|
environment:
|
2026-06-10 10:52:32 +08:00
|
|
|
|
- HIP_VISIBLE_DEVICES=1
|
2026-06-09 17:49:59 +08:00
|
|
|
|
- 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
|
|
|
|
|
|
- ${MIOPEN_CACHE:-./data/miopen}:/root/.cache/miopen
|
2026-06-10 15:14:00 +08:00
|
|
|
|
- ./scripts:/opt/scripts:ro
|
2026-06-11 11:37:52 +08:00
|
|
|
|
command: ["mineru-api", "--host", "0.0.0.0", "--port", "8002", "--allow-public-http-client"]
|
2026-06-10 10:52:32 +08:00
|
|
|
|
|
|
|
|
|
|
router:
|
|
|
|
|
|
image: mineru-rocm:7.2.1
|
|
|
|
|
|
container_name: mineru-router
|
|
|
|
|
|
stdin_open: true
|
|
|
|
|
|
tty: true
|
|
|
|
|
|
ipc: host
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "8000:8000"
|
|
|
|
|
|
environment:
|
|
|
|
|
|
- MINERU_MODEL_SOURCE=${MINERU_MODEL_SOURCE:-huggingface}
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
- ${INPUT_DIR:-./data/input}:/data/input:ro
|
|
|
|
|
|
- ${OUTPUT_DIR:-./data/output}:/data/output
|
2026-06-10 15:14:00 +08:00
|
|
|
|
- ./scripts:/opt/scripts:ro
|
2026-06-10 10:52:32 +08:00
|
|
|
|
command:
|
|
|
|
|
|
[
|
|
|
|
|
|
"mineru-router",
|
|
|
|
|
|
"--api-urls",
|
|
|
|
|
|
"http://mineru-worker0:8001,http://mineru-worker1:8002",
|
|
|
|
|
|
"--host", "0.0.0.0",
|
|
|
|
|
|
"--port", "8000",
|
2026-06-11 11:40:46 +08:00
|
|
|
|
"--allow-public-http-client",
|
2026-06-10 10:52:32 +08:00
|
|
|
|
]
|
|
|
|
|
|
depends_on:
|
|
|
|
|
|
- worker0
|
|
|
|
|
|
- worker1
|