Browse Source

Merge pull request #3096 from opendatalab/dev

fix: improve Dockerfile by adding fontconfig and purging pip cache
Xiaomeng Zhao 4 months ago
parent
commit
1842ab520e

+ 8 - 4
docker/china/Dockerfile

@@ -3,14 +3,18 @@ FROM lmsysorg/sglang:v0.4.8.post1-cu126
 
 # Install libgl for opencv support & Noto fonts for Chinese characters
 RUN apt-get update && \
-    apt-get install -y fonts-noto-core fonts-noto-cjk && \
-    apt-get install -y libgl1 && \
-    apt-get clean && \
+    apt-get install -y \
+        fonts-noto-core \
+        fonts-noto-cjk \
+        fontconfig \
+        libgl1 && \
     fc-cache -fv && \
+    apt-get clean && \
     rm -rf /var/lib/apt/lists/*
 
 # Install mineru latest
-RUN python3 -m pip install -U 'mineru[core]' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages
+RUN python3 -m pip install -U 'mineru[core]' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages && \
+    python3 -m pip cache purge
 
 # Download models and update the configuration file
 RUN /bin/bash -c "mineru-models-download -s modelscope -m all"

+ 9 - 5
docker/global/Dockerfile

@@ -1,16 +1,20 @@
 # Use the official sglang image
 FROM lmsysorg/sglang:v0.4.8.post1-cu126
 
-# Install libgl for opencv support
+# Install libgl for opencv support & Noto fonts for Chinese characters
 RUN apt-get update && \
-    apt-get install -y fonts-noto-core fonts-noto-cjk && \
-    apt-get install -y libgl1 && \
-    apt-get clean && \
+    apt-get install -y \
+        fonts-noto-core \
+        fonts-noto-cjk \
+        fontconfig \
+        libgl1 && \
     fc-cache -fv && \
+    apt-get clean && \
     rm -rf /var/lib/apt/lists/*
 
 # Install mineru latest
-RUN python3 -m pip install -U 'mineru[core]' --break-system-packages
+RUN python3 -m pip install -U 'mineru[core]' --break-system-packages && \
+    python3 -m pip cache purge
 
 # Download models and update the configuration file
 RUN /bin/bash -c "mineru-models-download -s huggingface -m all"

+ 4 - 4
docs/en/quick_start/docker_deployment.md

@@ -26,7 +26,7 @@ MinerU's Docker uses `lmsysorg/sglang` as the base image, so it includes the `sg
 >
 > If your device doesn't meet the above requirements, you can still use other features of MinerU, but cannot use `sglang` to accelerate VLM model inference, meaning you cannot use the `vlm-sglang-engine` backend or start the `vlm-sglang-server` service.
 
-## Start Docker Container:
+## Start Docker Container
 
 ```bash
 docker run --gpus all \
@@ -60,7 +60,7 @@ wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
 ### Start sglang-server service
 connect to `sglang-server` via `vlm-sglang-client` backend
   ```bash
-  docker compose -f compose.yaml --profile mineru-sglang-server up -d
+  docker compose -f compose.yaml --profile sglang-server up -d
   ```
   >[!TIP]
   >In another terminal, connect to sglang server via sglang client (only requires CPU and network, no sglang environment needed)
@@ -72,7 +72,7 @@ connect to `sglang-server` via `vlm-sglang-client` backend
 
 ### Start Web API service
   ```bash
-  docker compose -f compose.yaml --profile mineru-api up -d
+  docker compose -f compose.yaml --profile api up -d
   ```
   >[!TIP]
   >Access `http://<server_ip>:8000/docs` in your browser to view the API documentation.
@@ -81,7 +81,7 @@ connect to `sglang-server` via `vlm-sglang-client` backend
 
 ### Start Gradio WebUI service
   ```bash
-  docker compose -f compose.yaml --profile mineru-gradio up -d
+  docker compose -f compose.yaml --profile gradio up -d
   ```
   >[!TIP]
   >

+ 4 - 4
docs/zh/quick_start/docker_deployment.md

@@ -25,7 +25,7 @@ Mineru的docker使用了`lmsysorg/sglang`作为基础镜像,因此在docker中
 >
 > 如果您的设备不满足上述条件,您仍然可以使用MinerU的其他功能,但无法使用`sglang`加速VLM模型推理,即无法使用`vlm-sglang-engine`后端和启动`vlm-sglang-server`服务。
 
-## 启动 Docker 容器
+## 启动 Docker 容器
 
 ```bash
 docker run --gpus all \
@@ -58,7 +58,7 @@ wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
 ### 启动 sglang-server 服务
 并通过`vlm-sglang-client`后端连接`sglang-server`
   ```bash
-  docker compose -f compose.yaml --profile mineru-sglang-server up -d
+  docker compose -f compose.yaml --profile sglang-server up -d
   ```
   >[!TIP]
   >在另一个终端中通过sglang client连接sglang server(只需cpu与网络,不需要sglang环境)
@@ -70,7 +70,7 @@ wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
 
 ### 启动 Web API 服务
   ```bash
-  docker compose -f compose.yaml --profile mineru-api up -d
+  docker compose -f compose.yaml --profile api up -d
   ```
   >[!TIP]
   >在浏览器中访问 `http://<server_ip>:8000/docs` 查看API文档。
@@ -79,7 +79,7 @@ wget https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/compose.yaml
 
 ### 启动 Gradio WebUI 服务
   ```bash
-  docker compose -f compose.yaml --profile mineru-gradio up -d
+  docker compose -f compose.yaml --profile gradio up -d
   ```
   >[!TIP]
   >