File size: 1,139 Bytes
c83440a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29266d4
c83440a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM lmsysorg/sglang:v0.4.6.post3-cu124

WORKDIR /app

RUN useradd -m -u 1000 user

COPY <<"EOT" /app/start.sh
echo "mineru2.sglang_model.server start..."
python3 -m mineru2.sglang_model.server --model-path opendatalab/MinerU2.0-2505-0.9B --port 20000 &
while ! timeout 1 bash -c "cat < /dev/null > /dev/tcp/localhost/20000" 2>/dev/null; do
  sleep 1
done

echo "mineru2.gradio_app.webui_std start..."
python3 -m mineru2.gradio_app.webui_std --sgl-endpoint http://localhost:20000
EOT

ARG CACHEBUST=1

RUN --mount=type=secret,id=SYF_GITHUB_TOKEN,mode=0444,required=true \
  git config --global user.name "sunyuefeng" && \
  git config --global user.email "[email protected]" && \
  git clone https://$(cat /run/secrets/SYF_GITHUB_TOKEN)@github.com/general10/MinerU2.0-Inference.git && \
  # python3 -m pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple && \
  python3 -m pip install --no-cache-dir ./MinerU2.0-Inference[hf,sglang,gradio]

RUN chown user:user -R /app && \
  chmod +x /app/start.sh && \
  chown -R user:user / || true

USER user

ENV CUDA_HOME="/usr/local/cuda"

CMD ["/app/start.sh"]