|
| 1 | +FROM ocrd/core:latest AS base |
| 2 | +ENV VERSION="Di 12. Mai 13:26:35 CEST 2020" |
| 3 | +ENV GITURL="https://github.com/cisocrgroup" |
| 4 | +ENV DOWNLOAD_URL="http://cis.lmu.de/~finkf" |
| 5 | + |
| 6 | +# deps |
| 7 | +RUN apt-get update \ |
| 8 | + && apt-get -y install --no-install-recommends locales |
| 9 | + |
| 10 | +# locales |
| 11 | +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ |
| 12 | + && dpkg-reconfigure --frontend=noninteractive locales \ |
| 13 | + && update-locale LANG=en_US.UTF-8 |
| 14 | + |
| 15 | +# install the profiler |
| 16 | +FROM base AS profiler |
| 17 | +RUN apt-get update \ |
| 18 | + && apt-get -y install --no-install-recommends cmake g++ libcppunit-dev libxerces-c-dev \ |
| 19 | + && git clone ${GITURL}/Profiler --branch devel --single-branch /build \ |
| 20 | + && cd /build \ |
| 21 | + && cmake -DCMAKE_BUILD_TYPE=release . \ |
| 22 | + && make compileFBDic trainFrequencyList runDictSearch profiler \ |
| 23 | + && mkdir /apps \ |
| 24 | + && cp bin/compileFBDic bin/trainFrequencyList bin/profiler bin/runDictSearch /apps/ \ |
| 25 | + && cd / \ |
| 26 | + && rm -rf /build |
| 27 | + |
| 28 | +FROM profiler AS languagemodel |
| 29 | +# install the profiler's language backend |
| 30 | +COPY --from=profiler /apps/compileFBDic /apps/ |
| 31 | +COPY --from=profiler /apps/trainFrequencyList /apps/ |
| 32 | +COPY --from=profiler /apps/runDictSearch /apps/ |
| 33 | +RUN apt-get update \ |
| 34 | + && apt-get -y install --no-install-recommends icu-devtools \ |
| 35 | + && git clone ${GITURL}/Resources --branch master --single-branch /build \ |
| 36 | + && cd /build/lexica \ |
| 37 | + && PATH=$PATH:/apps make \ |
| 38 | + && PATH=$PATH:/apps make test \ |
| 39 | + && PATH=$PATH:/apps make install \ |
| 40 | + && cd / \ |
| 41 | + && rm -rf /build |
| 42 | + |
| 43 | +FROM base AS postcorrection |
| 44 | +# install ocrd_cis (python) |
| 45 | +VOLUME ["/data"] |
| 46 | +COPY --from=languagemodel /etc/profiler/languages /etc/profiler/languages |
| 47 | +COPY --from=profiler /apps/profiler /apps/ |
| 48 | +COPY --from=profiler /usr/lib/x86_64-linux-gnu/libicuuc.so /usr/lib//x86_64-linux-gnu/ |
| 49 | +COPY --from=profiler /usr/lib/x86_64-linux-gnu/libicudata.so /usr/lib//x86_64-linux-gnu/ |
| 50 | +COPY --from=profiler /usr/lib//x86_64-linux-gnu/libxerces-c-3.2.so /usr/lib//x86_64-linux-gnu/ |
| 51 | +COPY . /build |
| 52 | +RUN apt-get update \ |
| 53 | + && apt-get -y install --no-install-recommends gcc wget default-jre-headless \ |
| 54 | + && cd /build \ |
| 55 | + && make install \ |
| 56 | + && make test \ |
| 57 | + && cd / \ |
| 58 | + && rm -rf /build |
0 commit comments