diff --git a/deploy/docker/hubserving/cpu/Dockerfile b/deploy/docker/hubserving/cpu/Dockerfile index ef1a7b7b16fe1ebe26b5681a72f64d404dd77608..65e93f5ddb36f20c6248f485996ec7025e929c68 100644 --- a/deploy/docker/hubserving/cpu/Dockerfile +++ b/deploy/docker/hubserving/cpu/Dockerfile @@ -4,12 +4,19 @@ FROM registry.baidubce.com/paddlepaddle/paddle:2.0.0 # PaddleOCR base on Python3.7 RUN pip3.7 install --upgrade pip -i https://mirror.baidu.com/pypi/simple +# Fix error: versions don't match. Use the specified versions of paddlepaddle and paddlenlp. +RUN pip3.7 install paddlepaddle==2.1.0 -i https://mirror.baidu.com/pypi/simple +RUN pip3.7 install paddlenlp==2.0.2 -i https://mirror.baidu.com/pypi/simple + RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple -RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git /PaddleOCR +RUN git clone https://gitee.com/PaddlePaddle/PaddleOCR.git /PaddleOCR WORKDIR /PaddleOCR +# Switch code branch to avoid the mismatched versions. +RUN git checkout release/2.5 + RUN pip3.7 install -r requirements.txt -i https://mirror.baidu.com/pypi/simple RUN mkdir -p /PaddleOCR/inference/ @@ -27,4 +34,4 @@ RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/ EXPOSE 8868 -CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -m ocr_system"] \ No newline at end of file +CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -c /PaddleOCR/deploy/hubserving/ocr_system/config.json"] \ No newline at end of file