소스 검색

feat: add Docker Compose configuration and update README for container startup

myhloli 5 달 전
부모
커밋
55cb4c9064
3개의 변경된 파일43개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      README.md
  2. 8 0
      README_zh-CN.md
  3. 26 0
      docker/compose.yaml

+ 9 - 1
README.md

@@ -509,10 +509,13 @@ If you need to use **sglang to accelerate VLM model inference**, you can choose
   ```bash
   uv pip install -e .[all]
   ```
-- Build the Docker image:
+- Build image using Dockerfile:
   ```bash
   wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/global/Dockerfile
   docker build -t mineru-sglang:latest -f Dockerfile .
+  ```
+  Start Docker container:
+  ```bash
   docker run --gpus all \
     --shm-size 32g \
     -p 30000:30000 \
@@ -520,6 +523,11 @@ If you need to use **sglang to accelerate VLM model inference**, you can choose
     mineru-sglang:latest \
     mineru-sglang-server --host 0.0.0.0 --port 30000
   ```
+  Or start using Docker Compose:
+  ```bash
+    wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
+    docker compose -f compose.yaml up -d
+  ```
   
 > [!TIP]
 > The Dockerfile uses `lmsysorg/sglang:v0.4.7-cu124` as the default base image. If necessary, you can modify it to another platform version.

+ 8 - 0
README_zh-CN.md

@@ -503,6 +503,9 @@ uv pip install -e .[core] -i https://mirrors.aliyun.com/pypi/simple
   ```bash
   wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/Dockerfile
   docker build -t mineru-sglang:latest -f Dockerfile .
+  ```
+  启动 Docker 容器:
+  ```bash
   docker run --gpus all \
     --shm-size 32g \
     -p 30000:30000 \
@@ -510,6 +513,11 @@ uv pip install -e .[core] -i https://mirrors.aliyun.com/pypi/simple
     mineru-sglang:latest \
     mineru-sglang-server --host 0.0.0.0 --port 30000
   ```
+  或使用 Docker Compose 启动:
+  ```bash
+    wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
+    docker compose -f compose.yaml up -d
+  ```
   
 > [!TIP]
 > Dockerfile默认使用`lmsysorg/sglang:v0.4.7-cu124`作为基础镜像,如有需要,您可以自行修改为其他平台版本。

+ 26 - 0
docker/compose.yaml

@@ -0,0 +1,26 @@
+services:
+  mineru-sglang:
+    image: mineru-sglang:latest
+    container_name: mineru-sglang
+    restart: always
+    ports:
+      - 30000:30000
+    environment:
+      MINERU_MODEL_SOURCE: local
+    entrypoint: mineru-sglang-server
+    command:
+      --host 0.0.0.0
+      --port 30000
+    ulimits:
+      memlock: -1
+      stack: 67108864
+    ipc: host
+    healthcheck:
+      test: ["CMD-SHELL", "curl -f http://localhost:30000/health || exit 1"]
+    deploy:
+      resources:
+        reservations:
+          devices:
+            - driver: nvidia
+              device_ids: ["0"]
+              capabilities: [gpu]