Dockerfile-inference 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. FROM --platform=linux/amd64 nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
  2. RUN apt-get update -y && apt-get install -y software-properties-common \
  3. && add-apt-repository ppa:deadsnakes/ppa \
  4. && apt-get -y update
  5. # Install requirements specific to pdfs
  6. RUN apt-get update && apt-get -y install python3-apt
  7. RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
  8. RUN apt-get update -y && apt-get install -y poppler-utils ttf-mscorefonts-installer msttcorefonts fonts-crosextra-caladea fonts-crosextra-carlito gsfonts lcdf-typetools
  9. RUN apt-get update -y && apt-get install -y --no-install-recommends \
  10. git \
  11. python3.11 \
  12. python3.11-dev \
  13. python3.11-distutils \
  14. ca-certificates \
  15. build-essential \
  16. curl \
  17. unzip
  18. RUN rm -rf /var/lib/apt/lists/* \
  19. && unlink /usr/bin/python3 \
  20. && ln -s /usr/bin/python3.11 /usr/bin/python3 \
  21. && ln -s /usr/bin/python3 /usr/bin/python \
  22. && curl -sS https://bootstrap.pypa.io/get-pip.py | python \
  23. && pip3 install -U pip
  24. RUN apt-get update && apt-get -y install python3.11-venv
  25. ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
  26. RUN /install.sh && rm /install.sh
  27. ENV PYTHONUNBUFFERED=1
  28. WORKDIR /root
  29. COPY pyproject.toml pyproject.toml
  30. COPY olmocr/version.py olmocr/version.py
  31. RUN /root/.local/bin/uv pip install --system --no-cache -e .
  32. RUN /root/.local/bin/uv pip install --system --no-cache sgl-kernel==0.0.3.post1 --force-reinstall --no-deps
  33. RUN /root/.local/bin/uv pip install --system --no-cache "sglang[all]==0.4.2" --find-links https://flashinfer.ai/whl/cu124/torch2.4/flashinfer/
  34. COPY olmocr olmocr
  35. WORKDIR /root
  36. COPY olmocr olmocr
  37. RUN python3 -m sglang.launch_server --help
  38. RUN python3 -m olmocr.pipeline --help