compose.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. services:
  2. mineru-openai-server:
  3. image: mineru:latest
  4. container_name: mineru-openai-server
  5. restart: always
  6. profiles: ["openai-server"]
  7. ports:
  8. - 30000:30000
  9. environment:
  10. MINERU_MODEL_SOURCE: local
  11. entrypoint: mineru-openai-server
  12. command:
  13. --host 0.0.0.0
  14. --port 30000
  15. # --gpu-memory-utilization 0.5 # If encountering VRAM shortage, reduce the KV cache size by this parameter; if VRAM issues persist, try lowering it further to `0.4` or below.
  16. ulimits:
  17. memlock: -1
  18. stack: 67108864
  19. ipc: host
  20. healthcheck:
  21. test: ["CMD-SHELL", "curl -f http://localhost:30000/health || exit 1"]
  22. deploy:
  23. resources:
  24. reservations:
  25. devices:
  26. - driver: nvidia
  27. device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
  28. capabilities: [gpu]
  29. mineru-api:
  30. image: mineru:latest
  31. container_name: mineru-api
  32. restart: always
  33. profiles: ["api"]
  34. ports:
  35. - 23428:8000
  36. environment:
  37. #MINERU_MODEL_SOURCE: local
  38. # 模型源:与 --source modelscope 保持一致
  39. - MINERU_MODEL_SOURCE=modelscope
  40. # 模型缓存路径(容器内)
  41. - MODELSCOPE_CACHE=/root/.cache/modelscope
  42. - MINERU_CACHE_DIR=/root/.cache/mineru
  43. # Transformers/HF 缓存,避免路径冲突
  44. - TRANSFORMERS_CACHE=/root/.cache/huggingface/transformers
  45. - HF_HOME=/root/.cache/huggingface
  46. # 日志与语言
  47. - LOG_DIR=/app/logs
  48. - LANG=zh_CN.UTF-8
  49. - PYTHONUNBUFFERED=1
  50. - DEVICE=cuda
  51. # API Key 配置(根据实际版本选择)
  52. - MINERU_API_KEY=sk_dev_aC_2gg8BS5ImUScrpaHIKS5x6gdLO9Js_ba854894
  53. entrypoint: mineru-api
  54. command:
  55. --host 0.0.0.0
  56. --port 8000
  57. # --allow-public-http-client # Disabled by default; when binding to 0.0.0.0 or ::, this re-enables *-http-client backends and server_url. Enable only if you accept the SSRF risk.
  58. # parameters for vllm-engine
  59. # --gpu-memory-utilization 0.5 # If encountering VRAM shortage, reduce the KV cache size by this parameter; if VRAM issues persist, try lowering it further to `0.4` or below.
  60. volumes:
  61. # 1. 模型缓存持久化 (核心:避免重复下载)
  62. - /home/ubuntu/.cache/modelscope:/root/.cache/modelscope:rw
  63. # 2. MinerU 缓存持久化
  64. - /home/ubuntu/.cache/mineru:/root/.cache/mineru:rw
  65. - /home/ubuntu/.cache/huggingface:/root/.cache/huggingface:rw # 新增:避免 transformers 缓存冲突
  66. # 3. 日志目录映射
  67. - //home/ubuntu/lq_workspace/minerU/logs:/app/logs:rw
  68. # 4. 输入文件目录 (可选,如果 API 支持文件上传处理)
  69. - /home/ubuntu/lq_workspace/minerU/input:/app/input:ro
  70. # 5. 输出结果目录 (可选)
  71. - /home/ubuntu/lq_workspace/minerU/output:/app/output:rw
  72. # 6. 配置文件目录 (可选,如有自定义配置)
  73. - /home/ubuntu/lq_workspace/minerU/config:/app/config:ro
  74. ulimits:
  75. memlock: -1
  76. stack: 67108864
  77. ipc: host
  78. healthcheck:
  79. test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
  80. deploy:
  81. resources:
  82. reservations:
  83. devices:
  84. - driver: nvidia
  85. device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
  86. capabilities: [gpu]
  87. mineru-router:
  88. image: mineru:latest
  89. container_name: mineru-router
  90. restart: always
  91. profiles: ["router"]
  92. ports:
  93. - 8002:8002
  94. environment:
  95. MINERU_MODEL_SOURCE: local
  96. # API Key 配置(根据实际版本选择)
  97. MINERU_API_KEY: "sk_dev_aC_2gg8BS5ImUScrpaHIKS5x6gdLO9Js_ba854894"
  98. entrypoint: mineru-router
  99. command:
  100. --host 0.0.0.0
  101. --port 8002
  102. --local-gpus auto
  103. # --allow-public-http-client # Disabled by default; when binding to 0.0.0.0 or ::, this re-enables *-http-client backends and server_url. Enable only if you accept the SSRF risk.
  104. # To aggregate existing mineru-api services instead of starting local workers:
  105. # --local-gpus none
  106. # --upstream-url http://mineru-api:8000
  107. # --upstream-url http://mineru-api-2:8000
  108. # parameters for vllm-engine
  109. # --gpu-memory-utilization 0.5 # If encountering VRAM shortage, reduce the KV cache size by this parameter; if VRAM issues persist, try lowering it further to `0.4` or below.
  110. ulimits:
  111. memlock: -1
  112. stack: 67108864
  113. ipc: host
  114. healthcheck:
  115. test: ["CMD-SHELL", "curl -f http://localhost:8002/health || exit 1"]
  116. deploy:
  117. resources:
  118. reservations:
  119. devices:
  120. - driver: nvidia
  121. device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
  122. capabilities: [gpu]
  123. mineru-gradio:
  124. image: mineru:latest
  125. container_name: mineru-gradio
  126. restart: always
  127. profiles: ["gradio"]
  128. ports:
  129. - 7860:7860
  130. environment:
  131. MINERU_MODEL_SOURCE: local
  132. entrypoint: mineru-gradio
  133. command:
  134. --server-name 0.0.0.0
  135. --server-port 7860
  136. # --enable-api false # If you want to disable the API, set this to false
  137. # --max-convert-pages 20 # If you want to limit the number of pages for conversion, set this to a specific number
  138. # parameters for vllm-engine
  139. # --gpu-memory-utilization 0.5 # If encountering VRAM shortage, reduce the KV cache size by this parameter; if VRAM issues persist, try lowering it further to `0.4` or below.
  140. ulimits:
  141. memlock: -1
  142. stack: 67108864
  143. ipc: host
  144. deploy:
  145. resources:
  146. reservations:
  147. devices:
  148. - driver: nvidia
  149. device_ids: ["0"] # Modify for multiple GPUs: ["0", "1"]
  150. capabilities: [gpu]