FROM debian:10-slim
LABEL authors="Patrick Jentsch
, Stephan Porada "
ENV LANG=C.UTF-8
RUN apt-get update
# Install pipeline dependencies #
## Install pyFlow ##
ENV PYFLOW_RELEASE=1.1.20
ADD "https://github.com/Illumina/pyflow/releases/download/v${PYFLOW_RELEASE}/pyflow-${PYFLOW_RELEASE}.tar.gz" .
RUN tar -xzf "pyflow-${PYFLOW_RELEASE}.tar.gz" \
&& cd "pyflow-${PYFLOW_RELEASE}" \
&& apt-get update \
&& apt-get install --no-install-recommends --yes \
python2.7 \
&& rm -r /var/lib/apt/lists/* \
&& python2.7 setup.py build install \
&& cd .. \
&& rm -r "pyflow-${PYFLOW_RELEASE}" "pyflow-${PYFLOW_RELEASE}.tar.gz"
## Install ocropy ##
ENV OCROPY_RELEASE 1.3.3
ADD "https://github.com/tmbdev/ocropy/archive/v${OCROPY_RELEASE}.tar.gz" .
RUN tar -xzf "v${OCROPY_RELEASE}.tar.gz" \
&& cd "ocropy-${OCROPY_RELEASE}" \
&& apt-get update \
&& apt-get install --no-install-recommends --yes \
python-pil \
python-tk \
$(cat PACKAGES) \
&& rm -r /var/lib/apt/lists/* \
&& python2.7 setup.py install \
&& cd .. \
&& rm -r "ocropy-${OCROPY_RELEASE}" "v${OCROPY_RELEASE}.tar.gz"
## Install Tesseract OCR ##
ENV TESSERACT_RELEASE=4.1.1
ADD "https://github.com/tesseract-ocr/tesseract/archive/${TESSERACT_RELEASE}.tar.gz" .
RUN tar -xzf "${TESSERACT_RELEASE}.tar.gz" \
&& cd "tesseract-${TESSERACT_RELEASE}" \
&& apt-get update \
&& apt-get install --no-install-recommends --yes \
autoconf \
automake \
g++ \
libjpeg62-turbo-dev \
libleptonica-dev \
libtiff5-dev \
libtool \
libpng-dev \
make \
pkg-config \
zlib1g-dev \
&& rm -r /var/lib/apt/lists/* \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install \
&& ldconfig \
&& cd - > /dev/null \
&& rm -r "tesseract-${TESSERACT_RELEASE}" "${TESSERACT_RELEASE}.tar.gz"
ADD "https://github.com/tesseract-ocr/tessdata_best/raw/master/deu.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/eng.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/enm.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/fra.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/frk.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/frm.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/ita.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/por.traineddata" \
"https://github.com/tesseract-ocr/tessdata_best/raw/master/spa.traineddata" \
"/usr/local/share/tessdata/"
RUN chmod 644 /usr/local/share/tessdata/*.traineddata
## Further dependencies ##
RUN apt-get update \
&& apt-get install --no-install-recommends --yes \
ghostscript \
python-pip \
python3.7 \
zip \
&& rm -r /var/lib/apt/lists/* \
&& pip install natsort
## Install Pipeline ##
COPY hocrtotei ocr /usr/local/bin/
ENTRYPOINT ["ocr"]
CMD ["--help"]