SunYuefeng commited on
Commit
c83440a
Β·
1 Parent(s): 04d2662

add dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +35 -0
  2. README.md +6 -3
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM lmsysorg/sglang:v0.4.6.post3-cu124
2
+
3
+ WORKDIR /app
4
+
5
+ RUN useradd -m -u 1000 user
6
+
7
+ COPY <<"EOT" /app/start.sh
8
+ echo "mineru2.sglang_model.server start..."
9
+ python3 -m mineru2.sglang_model.server --model-path opendatalab/MinerU2.0-2505-0.9B --port 20000 &
10
+ while ! timeout 1 bash -c "cat < /dev/null > /dev/tcp/localhost/20000" 2>/dev/null; do
11
+ sleep 1
12
+ done
13
+
14
+ echo "mineru2.gradio_app.webui_std start..."
15
+ python3 -m mineru2.gradio_app.webui_std --sgl-endpoint http://localhost:20000
16
+ EOT
17
+
18
+ ARG CACHEBUST=1
19
+
20
+ RUN --mount=type=secret,id=SYF_GITHUB_TOKEN,mode=0444,required=true \
21
+ git config --global user.name "sunyuefeng" && \
22
+ git config --global user.email "[email protected]" && \
23
+ git clone https://$(cat /run/secrets/SYF_GITHUB_TOKEN)@github.com/general10/MinerU2.0-Inference.git && \
24
+ # python3 -m pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple && \
25
+ python3 -m pip install --no-cache-dir ./MinerU2.0-Inference[hf,sglang,gradio]
26
+
27
+ RUN chown user:user -R /app && \
28
+ chmod +x /app/start.sh && \
29
+ chown -R user:user / || true
30
+
31
+ USER user
32
+
33
+ ENV CUDA_HOME="/usr/local/cuda"
34
+
35
+ CMD ["/app/start.sh"]
README.md CHANGED
@@ -1,11 +1,14 @@
1
  ---
2
  title: Mineru2
3
- emoji: 🐨
4
  colorFrom: gray
5
- colorTo: green
6
  sdk: docker
7
  pinned: false
8
  short_description: mineru2
 
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
  title: Mineru2
3
+ emoji: πŸ“„
4
  colorFrom: gray
5
+ colorTo: blue
6
  sdk: docker
7
  pinned: false
8
  short_description: mineru2
9
+ app_port: 7860
10
  ---
11
 
12
+ space of mineru2
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference