Dockerfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Use the official Ubuntu base image
  2. FROM ubuntu:22.04
  3. # Set environment variables to non-interactive to avoid prompts during installation
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. # Update the package list and install necessary packages
  6. RUN apt-get update && \
  7. apt-get install -y \
  8. software-properties-common && \
  9. add-apt-repository ppa:deadsnakes/ppa && \
  10. apt-get update && \
  11. apt-get install -y \
  12. python3.10 \
  13. python3.10-venv \
  14. python3.10-distutils \
  15. python3-pip \
  16. wget \
  17. git \
  18. libgl1 \
  19. libglib2.0-0 \
  20. && rm -rf /var/lib/apt/lists/*
  21. # Set Python 3.10 as the default python3
  22. RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
  23. # install mineru latest
  24. RUN /bin/bash -c "pip3 install --upgrade pip && \
  25. pip3 install uv && \
  26. uv pip install 'mineru[all]>=2.0.0'"
  27. # Download models and update the configuration file
  28. RUN /bin/bash -c "mineru-models-download -s huggingface -m all"
  29. # Set the entry point to activate the virtual environment and run the command line tool
  30. ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]