Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +16 -11
Dockerfile
CHANGED
@@ -1,24 +1,29 @@
|
|
1 |
# Dockerfile
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
# Avoid .pyc and enable unbuffered logs
|
5 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
6 |
PYTHONUNBUFFERED=1
|
7 |
|
8 |
WORKDIR /app
|
9 |
|
10 |
-
# Install system deps for
|
11 |
-
RUN apt-get update
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
# Install Python deps
|
17 |
-
|
18 |
-
RUN pip install --upgrade pip
|
19 |
-
|
|
|
|
|
20 |
|
21 |
-
#
|
|
|
|
|
|
|
|
|
22 |
COPY app.py .
|
23 |
|
24 |
EXPOSE 7860
|
|
|
1 |
# Dockerfile
|
2 |
FROM python:3.10-slim
|
3 |
|
|
|
4 |
ENV PYTHONDONTWRITEBYTECODE=1 \
|
5 |
PYTHONUNBUFFERED=1
|
6 |
|
7 |
WORKDIR /app
|
8 |
|
9 |
+
# 1) Install system deps (for wget/git) and cleanup
|
10 |
+
RUN apt-get update \
|
11 |
+
&& apt-get install -y --no-install-recommends \
|
12 |
+
wget git \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
+
# 2) Install Python deps: Gradio + MinerU (magic-pdf full build)
|
16 |
+
# Note: extra-index-url is required for detectron2 wheels
|
17 |
+
RUN pip install --upgrade pip \
|
18 |
+
&& pip install gradio \
|
19 |
+
&& pip install -U "magic-pdf[full]" \
|
20 |
+
--extra-index-url https://wheels.myhloli.com # MinerU package :contentReference[oaicite:2]{index=2}
|
21 |
|
22 |
+
# 3) Download MinerU model weights (script from upstream)
|
23 |
+
RUN wget https://github.com/opendatalab/MinerU/raw/master/scripts/download_models_hf.py -O download_models_hf.py \
|
24 |
+
&& python download_models_hf.py
|
25 |
+
|
26 |
+
# 4) Copy application code
|
27 |
COPY app.py .
|
28 |
|
29 |
EXPOSE 7860
|