FROM debian:bullseye

#Update
RUN apt update -y && apt upgrade -y

#Build dependencies
RUN apt install -y git build-essential cmake 

#Dependencies from repos (qt5, openssl, tesseract and lang package)
RUN apt install -y qtbase5-dev openssl libmbedtls-dev tesseract-ocr tesseract-ocr-rus libopencv-dev

#Dependencies from sources 
#cpr
WORKDIR /root
RUN git clone https://github.com/whoshuu/cpr.git && \
    cd cpr && \
    mkdir build && cd build && \
    cmake .. && \
    make -j ${nproc} && \
    make install && \
    cd /root && rm -rf cpr


#building

WORKDIR /root
RUN git clone https://git.foxarmy.org/leca/checks-parser && \
    cd checks-parser && \
    mkdir build && cd build &&\
    cmake .. && \
    make -j ${nproc} && \
    make install && \
    
ENTRYPOINT ["checks-parser"]
