-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (48 loc) · 1.73 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04
# Avoid interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
poppler-utils \
wget \
git \
build-essential \
python3-pip \
curl \
software-properties-common \
&& add-apt-repository multiverse \
&& apt-get update \
&& apt-get install -y ttf-mscorefonts-installer \
fonts-crosextra-caladea fonts-crosextra-carlito gsfonts lcdf-typetools
# Accept Microsoft font license terms
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
# Install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh \
&& bash /tmp/miniconda.sh -b -p /opt/conda \
&& rm /tmp/miniconda.sh
# Set conda in PATH
ENV PATH="/opt/conda/bin:${PATH}"
# Create conda environment
RUN conda create -y -n olmocr python=3.11 \
&& echo "source activate olmocr" > ~/.bashrc
# Activate conda environment and install olmocr
SHELL ["/bin/bash", "-c"]
RUN source activate olmocr \
&& git clone https://github.com/allenai/olmocr.git \
&& cd olmocr \
&& pip install -e .
# Install sglang with flashinfer for GPU
RUN source activate olmocr \
&& pip install sgl-kernel==0.0.3.post1 --force-reinstall --no-deps \
&& pip install "sglang[all]==0.4.2" --find-links https://flashinfer.ai/whl/cu124/torch2.4/flashinfer/
# Install Gradio
RUN source activate olmocr \
&& pip install gradio
# Copy the Gradio app
COPY app.py /app/app.py
# Expose port for Gradio
EXPOSE 7860
# Set working directory
WORKDIR /app
# Startup command
CMD ["bash", "-c", "source activate olmocr && python app.py"]