FROM my_ocrd_workflow-core

ARG PIP_INSTALL="pip3 install --no-cache-dir --use-feature=2020-resolver"
ARG SBB_TEXTLINE_DETECTOR_COMMIT="247d5f9"


# Build pip installable stuff
RUN ${PIP_INSTALL} \
    # https://github.com/qurator-spk/sbb_textline_detection/issues/50
    "h5py < 3" \
    https://github.com/qurator-spk/sbb_textline_detector/archive/$SBB_TEXTLINE_DETECTOR_COMMIT.tar.gz


# Copy OCR models
COPY data/textline_detection /var/lib/textline_detection


# Check pip dependencies
RUN pip3 check


# Default command
CMD ["ocrd-sbb-textline-detector"]