docker 파일 추가

This commit is contained in:
2025-10-27 12:22:40 +09:00
parent 1942be551f
commit 2e749bf170
3 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Dots OCR has been officially integrated into vLLM since v0.11.0
# Below is the dockerfile for out-of-tree model registration support based on v0.9.1
from vllm/vllm-openai:v0.9.1
RUN pip3 install flash_attn==2.8.0.post2
RUN pip3 install transformers==4.51.3

View File

@@ -0,0 +1,43 @@
version: '3.8'
services:
dots-ocr-server:
image: rednotehilab/dots.ocr:vllm-openai-v0.9.1
container_name: dots-ocr-container
ports:
- "8000:8000"
volumes:
#download model to localmodel urlhttps://www.modelscope.cn/models/rednote-hilab/dots.ocr
- ./model/dots.ocr:/workspace/weights/DotsOCR
environment:
- PYTHONPATH=/workspace/weights:$PYTHONPATH
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
device_ids: ['0']
entrypoint: /bin/bash
command:
- -c
- |
set -ex;
echo '--- Starting setup and server ---';
echo 'Modifying vllm entrypoint...';
# This sed command patches the vllm entrypoint script to import the custom modeling code.
sed -i '/^from vllm\.entrypoints\.cli\.main import main/a from DotsOCR import modeling_dots_ocr_vllm' $(which vllm) && \
echo 'vllm script after patch:';
# Show the patched part of the vllm script for verification.
grep -A 1 'from vllm.entrypoints.cli.main import main' $(which vllm) && \
echo 'Starting server...';
# Use 'exec' to replace the current shell process with the vllm server,
# ensuring logs are properly forwarded to Docker's standard output.
exec vllm serve /workspace/weights/DotsOCR \
--tensor-parallel-size 1 \
--gpu-memory-utilization 0.8 \
--chat-template-content-format string \
--served-model-name dotsocr-model \
--trust-remote-code

View File

@@ -0,0 +1,21 @@
version: "3.9"
services:
paddlex-genai-vllm:
image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddlex-genai-vllm-server
container_name: paddlex-genai-vllm
command: >
paddlex_genai_server
--model_name PaddleOCR-VL-0.9B
--host 0.0.0.0
--port 8118
--backend vllm
restart: unless-stopped
network_mode: host
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
stdin_open: true
tty: true