27 lines
1.4 KiB
Docker
27 lines
1.4 KiB
Docker
# MinerU 2.7.6 on the previously shipped, smaller NVIDIA runtime.
|
|
ARG BASE_IMAGE
|
|
FROM ${BASE_IMAGE}
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
MINERU_MODEL_SOURCE=local \
|
|
MINERU_MODEL_DIR=/models \
|
|
MINERU_TOOLS_CONFIG_JSON=/root/mineru.json \
|
|
MINERU_API_MAX_CONCURRENT_REQUESTS=1
|
|
WORKDIR /app
|
|
# Remove old application sources before copying the pinned 2.7.6 checkout.
|
|
RUN rm -rf /app && mkdir -p /app
|
|
COPY . /app
|
|
RUN python3 -c "from pathlib import Path; p=Path('pyproject.toml'); s=p.read_text(); old='gradio==5.49.1'; assert s.count(old)==1; p.write_text(s.replace(old, 'gradio==5.50.0'))"
|
|
ARG PIP_INDEX_URL
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
python3 scripts/accelerator_constraints.py /tmp/accelerator-constraints.txt && \
|
|
printf 'opencv-python-headless==4.11.0.86\ncupy-cuda12x==13.6.0\n' > /tmp/cuda-slim-constraints.txt && \
|
|
python3 -m pip install --no-build-isolation \
|
|
-c /tmp/accelerator-constraints.txt -c docker/constraints-2.7.6.txt -c /tmp/cuda-slim-constraints.txt '.[core]' 'cupy-cuda12x==13.6.0' && \
|
|
python3 scripts/accelerator_constraints.py /tmp/accelerator-constraints.txt --check && \
|
|
python3 -m pip check && \
|
|
python3 -c "from mineru.version import __version__; assert __version__ == '2.7.6'" && \
|
|
chmod +x docker/entrypoint.mineru-api.sh
|
|
EXPOSE 8000
|
|
ENTRYPOINT ["/app/docker/entrypoint.mineru-api.sh"]
|
|
CMD ["mineru-api", "--host", "0.0.0.0", "--port", "8000"]
|