Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930
  1. # Version: 2.0.0
  2. FROM registry.baidubce.com/paddlepaddle/paddle:2.0.0
  3. # PaddleOCR base on Python3.7
  4. RUN pip3.7 install --upgrade pip -i https://mirror.baidu.com/pypi/simple
  5. RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple
  6. RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git /PaddleOCR
  7. WORKDIR /PaddleOCR
  8. RUN pip3.7 install -r requirements.txt -i https://mirror.baidu.com/pypi/simple
  9. RUN mkdir -p /PaddleOCR/inference/
  10. # Download orc detect model(light version). if you want to change normal version, you can change ch_ppocr_mobile_v2.0_det_infer to ch_ppocr_server_v2.0_det_infer, also remember change det_model_dir in deploy/hubserving/ocr_system/params.py)
  11. ADD {link} /PaddleOCR/inference/
  12. RUN tar xf /PaddleOCR/inference/{file} -C /PaddleOCR/inference/
  13. # Download direction classifier(light version). If you want to change normal version, you can change ch_ppocr_mobile_v2.0_cls_infer to ch_ppocr_mobile_v2.0_cls_infer, also remember change cls_model_dir in deploy/hubserving/ocr_system/params.py)
  14. ADD {link} /PaddleOCR/inference/
  15. RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/
  16. # Download orc recognition model(light version). If you want to change normal version, you can change ch_ppocr_mobile_v2.0_rec_infer to ch_ppocr_server_v2.0_rec_infer, also remember change rec_model_dir in deploy/hubserving/ocr_system/params.py)
  17. ADD {link} /PaddleOCR/inference/
  18. RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/
  19. EXPOSE 8868
  20. CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -m ocr_system"]