"torchvision/vscode:/vscode.git/clone" did not exist on "03d11338f3faf94a0749549912593ddb8b70be17"
Commit 2e1bf881 authored by myhloli's avatar myhloli
Browse files

build(docker): update Dockerfiles for China and Huawei NPU versions

- Update package sources to use Aliyun mirrors for faster downloads
- Upgrade pip and install Python packages in virtual environment
- Add python3.10-dev package to Huawei NPU Dockerfile
- Update requirements file URLs to master branch- Install specific version of torch_npu in Huawei NPU Dockerfile
- Update magic-pdf installation method
- Improve modelscope installation process
- Optimize model download and configuration update steps
parent 36c3ad6f
......@@ -29,7 +29,7 @@ RUN python3 -m venv /opt/mineru_venv
# Activate the virtual environment and install necessary Python packages
RUN /bin/bash -c "source /opt/mineru_venv/bin/activate && \
pip3 install --upgrade pip && \
pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple && \
wget https://gitee.com/myhloli/MinerU/raw/master/docker/china/requirements.txt -O requirements.txt && \
pip3 install -r requirements.txt --extra-index-url https://wheels.myhloli.com -i https://mirrors.aliyun.com/pypi/simple && \
pip3 install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/"
......
# Use the official Ubuntu base image
FROM swr.cn-south-1.myhuaweicloud.com/ascendhub/ascend-infer:24.0.RC3-ubuntu20.04
FROM swr.cn-central-221.ovaijisuan.com/mindformers/mindformers1.2_mindspore2.3:20240722
USER root
# Set environment variables to non-interactive to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
......@@ -14,7 +16,8 @@ RUN apt-get update && \
python3.10 \
python3.10-venv \
python3.10-distutils \
python3-pip \
python3.10-dev \
python3-pip \
wget \
git \
libgl1 \
......@@ -29,21 +32,24 @@ RUN python3 -m venv /opt/mineru_venv
# Activate the virtual environment and install necessary Python packages
RUN /bin/bash -c "source /opt/mineru_venv/bin/activate && \
pip3 install --upgrade pip && \
wget https://gitee.com/myhloli/MinerU/raw/dev/docker/huawei_npu/requirements.txt -O requirements.txt && \
pip3 install -r requirements.txt --extra-index-url https://wheels.myhloli.com -i https://mirrors.aliyun.com/pypi/simple"
pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple && \
wget https://gitee.com/myhloli/MinerU/raw/master/docker/huawei_npu/requirements.txt -O requirements.txt && \
pip3 install -r requirements.txt --extra-index-url https://wheels.myhloli.com -i https://mirrors.aliyun.com/pypi/simple && \
wget https://gitee.com/ascend/pytorch/releases/download/v6.0.rc2-pytorch2.3.1/torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl && \
pip install torch_npu-2.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"
# Copy the configuration file template and install magic-pdf latest
RUN /bin/bash -c "wget https://gitee.com/myhloli/MinerU/raw/master/magic-pdf.template.json && \
cp magic-pdf.template.json /root/magic-pdf.json && \
source /opt/mineru_venv/bin/activate && \
pip3 install git+https://gitee.com/myhloli/MinerU.git@dev"
pip3 install -U magic-pdf"
# Download models and update the configuration file
RUN /bin/bash -c "pip3 install modelscope && \
RUN /bin/bash -c "source /opt/mineru_venv/bin/activate && \
pip3 install modelscope -i https://mirrors.aliyun.com/pypi/simple && \
wget https://gitee.com/myhloli/MinerU/raw/master/scripts/download_models.py -O download_models.py && \
python3 download_models.py && \
sed -i 's|cpu|npu|g' /root/magic-pdf.json"
# Set the entry point to activate the virtual environment and run the command line tool
ENTRYPOINT ["/bin/bash", "-c", "source /opt/mineru_venv/bin/activate && exec \"$@\"", "--"]
ENTRYPOINT ["/bin/bash", "-c", "source /opt/mineru_venv/bin/activate && exec \"$@\"", "--"]
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment