71 lines
2.1 KiB
Plaintext
71 lines
2.1 KiB
Plaintext
# PaddleOCR-VL GPU Variant
|
|
# Vision-Language Model for document parsing using vLLM
|
|
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
|
|
|
|
LABEL maintainer="Task Venture Capital GmbH <hello@task.vc>"
|
|
LABEL description="PaddleOCR-VL 0.9B - Vision-Language Model for document parsing"
|
|
LABEL org.opencontainers.image.source="https://code.foss.global/host.today/ht-docker-ai"
|
|
|
|
# Environment configuration
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV HF_HOME=/root/.cache/huggingface
|
|
ENV VLLM_WORKER_MULTIPROC_METHOD=spawn
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3.11 \
|
|
python3.11-venv \
|
|
python3.11-dev \
|
|
python3-pip \
|
|
git \
|
|
curl \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 \
|
|
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
|
|
|
|
# Create and activate virtual environment
|
|
RUN python -m venv /opt/venv
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
# Install PyTorch with CUDA support
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir \
|
|
torch==2.5.1 \
|
|
torchvision \
|
|
--index-url https://download.pytorch.org/whl/cu124
|
|
|
|
# Install vLLM 0.11.1 (first stable release with PaddleOCR-VL support)
|
|
RUN pip install --no-cache-dir \
|
|
vllm==0.11.1 \
|
|
--extra-index-url https://download.pytorch.org/whl/cu124
|
|
|
|
# Install additional dependencies
|
|
RUN pip install --no-cache-dir \
|
|
transformers \
|
|
accelerate \
|
|
safetensors \
|
|
pillow \
|
|
fastapi \
|
|
uvicorn[standard] \
|
|
python-multipart \
|
|
openai \
|
|
httpx
|
|
|
|
# Copy entrypoint script
|
|
COPY image_support_files/paddleocr-vl-entrypoint.sh /usr/local/bin/paddleocr-vl-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/paddleocr-vl-entrypoint.sh
|
|
|
|
# Expose vLLM API port
|
|
EXPOSE 8000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=300s --retries=3 \
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
ENTRYPOINT ["/usr/local/bin/paddleocr-vl-entrypoint.sh"]
|