|
@@ -1,5 +1,7 @@
|
|
|
# Use the official Ubuntu base image
|
|
# 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
|
|
# Set environment variables to non-interactive to avoid prompts during installation
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
@@ -14,7 +16,8 @@ RUN apt-get update && \
|
|
|
python3.10 \
|
|
python3.10 \
|
|
|
python3.10-venv \
|
|
python3.10-venv \
|
|
|
python3.10-distutils \
|
|
python3.10-distutils \
|
|
|
- python3-pip \
|
|
|
|
|
|
|
+ python3.10-dev \
|
|
|
|
|
+ python3-pip \
|
|
|
wget \
|
|
wget \
|
|
|
git \
|
|
git \
|
|
|
libgl1 \
|
|
libgl1 \
|
|
@@ -29,21 +32,24 @@ RUN python3 -m venv /opt/mineru_venv
|
|
|
|
|
|
|
|
# Activate the virtual environment and install necessary Python packages
|
|
# Activate the virtual environment and install necessary Python packages
|
|
|
RUN /bin/bash -c "source /opt/mineru_venv/bin/activate && \
|
|
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
|
|
# 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 && \
|
|
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 && \
|
|
cp magic-pdf.template.json /root/magic-pdf.json && \
|
|
|
source /opt/mineru_venv/bin/activate && \
|
|
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
|
|
# 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 && \
|
|
wget https://gitee.com/myhloli/MinerU/raw/master/scripts/download_models.py -O download_models.py && \
|
|
|
python3 download_models.py && \
|
|
python3 download_models.py && \
|
|
|
sed -i 's|cpu|npu|g' /root/magic-pdf.json"
|
|
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
|
|
# 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 \"$@\"", "--"]
|