olmocr/Dockerfile

49 lines
1.7 KiB
Docker
Raw Normal View History

2025-05-21 10:57:04 -07:00
FROM --platform=linux/amd64 nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
RUN apt-get update -y && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get -y update
RUN apt-get update && apt-get -y install python3-apt
RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
RUN apt-get update -y && apt-get install -y poppler-utils ttf-mscorefonts-installer msttcorefonts fonts-crosextra-caladea fonts-crosextra-carlito gsfonts lcdf-typetools
RUN apt-get update -y && apt-get install -y --no-install-recommends \
git \
2025-05-29 17:38:00 +00:00
git-lfs \
2025-05-21 10:57:04 -07:00
python3.11 \
python3.11-dev \
python3.11-distutils \
ca-certificates \
build-essential \
curl \
2025-05-28 14:35:23 -07:00
wget \
2025-05-21 10:57:04 -07:00
unzip
RUN rm -rf /var/lib/apt/lists/* \
&& unlink /usr/bin/python3 \
&& ln -s /usr/bin/python3.11 /usr/bin/python3 \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python \
&& pip3 install -U pip
RUN apt-get update && apt-get -y install python3.11-venv
ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh
RUN /install.sh && rm /install.sh
ENV PYTHONUNBUFFERED=1
2025-05-29 16:12:06 +00:00
2025-05-21 10:57:04 -07:00
WORKDIR /root
COPY pyproject.toml pyproject.toml
COPY olmocr/version.py olmocr/version.py
RUN /root/.local/bin/uv pip install --system --no-cache -e .
RUN /root/.local/bin/uv pip install --system --no-cache ".[gpu]" --find-links https://flashinfer.ai/whl/cu124/torch2.4/flashinfer/
RUN /root/.local/bin/uv pip install --system --no-cache ".[bench]"
2025-05-22 14:28:40 -07:00
RUN playwright install-deps
RUN playwright install chromium
2025-05-21 10:57:04 -07:00
COPY olmocr olmocr
2025-05-28 14:35:23 -07:00
COPY scripts scripts
2025-05-21 10:57:04 -07:00
2025-05-22 14:28:40 -07:00
RUN python3 -m sglang.launch_server --help
2025-05-21 10:57:04 -07:00
RUN python3 -m olmocr.pipeline --help