start_mineru_in_container.sh 835 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. # 在 Docker 容器内启动 MinerU file_parse API(容器内无 systemd,用本脚本代替 systemd 服务)
  3. # 使用:bash start_mineru_in_container.sh 或 nohup bash start_mineru_in_container.sh &
  4. # 工作目录:/root/work/Clerk2.5(可通过 CLERK_ROOT 覆盖)
  5. set -e
  6. CLERK_ROOT="${CLERK_ROOT:-/root/work/Clerk2.5}"
  7. PORT="${MINERU_PORT:-5282}"
  8. # NPU/容器内需预加载 libgomp,避免 static TLS 报错(路径以常见 dist-packages 为准,可按本机修改)
  9. 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}"
  10. export PYTHONPATH="${CLERK_ROOT}"
  11. cd "$CLERK_ROOT"
  12. exec python3 -m uvicorn mineru.cli.fast_api:app --host 0.0.0.0 --port "$PORT"