- #!/usr/bin/env bash
- # 在 Docker 容器内启动 MinerU file_parse API(容器内无 systemd,用本脚本代替 systemd 服务)
- # 使用:bash start_mineru_in_container.sh 或 nohup bash start_mineru_in_container.sh &
- # 工作目录:/root/work/Clerk2.5(可通过 CLERK_ROOT 覆盖)
- set -e
- CLERK_ROOT="${CLERK_ROOT:-/root/work/Clerk2.5}"
- PORT="${MINERU_PORT:-5282}"
- # NPU/容器内需预加载 libgomp,避免 static TLS 报错(路径以常见 dist-packages 为准,可按本机修改)
- export LD_PRELOAD="${LD_PRELOAD:-/usr/local/lib/python3.10/dist-packages/simsimd.libs/libgomp-a49a47f9.so.1.0.0:/usr/local/lib/python3.10/dist-packages/scikit_learn.libs/libgomp-d22c30c5.so.1.0.0}"
- export PYTHONPATH="${CLERK_ROOT}"
- cd "$CLERK_ROOT"
- exec python3 -m uvicorn mineru.cli.fast_api:app --host 0.0.0.0 --port "$PORT"
|