Marc Kupietz | a377441 | 2022-06-10 21:46:22 +0200 | [diff] [blame^] | 1 | FROM metacpan/metacpan-api as builder |
| 2 | |
| 3 | # Copy repository respecting .dockerignore |
| 4 | COPY . /derekovecs |
| 5 | |
| 6 | WORKDIR /derekovecs |
| 7 | |
| 8 | RUN apt update && apt -y install cmake libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev |
| 9 | |
| 10 | RUN git config --global user.email "korap+docker@ids-mannheim.de" && \ |
| 11 | git config --global user.name "Docker" |
| 12 | |
| 13 | # Install RocksDB |
| 14 | RUN curl -L https://github.com/facebook/rocksdb/archive/refs/tags/v5.11.3.tar.gz | tar zx && \ |
| 15 | cd rocksdb-5.11.3 && \ |
| 16 | export PROCS=$(nproc) && \ |
| 17 | make -j $PROCS static_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \ |
| 18 | make install-static DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \ |
| 19 | make -j $PROCS shared_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \ |
| 20 | make install-shared DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \ |
| 21 | ldconfig && \ |
| 22 | cd .. |
| 23 | |
| 24 | |
| 25 | RUN rm -rf rocksdb-5.11.3 |
| 26 | |
| 27 | # Install collocatordb |
| 28 | RUN git clone "https://korap.ids-mannheim.de/gerrit/ids-kl/collocatordb" && \ |
| 29 | cd collocatordb && \ |
| 30 | mkdir -p build && \ |
| 31 | cd build && \ |
| 32 | cmake .. && \ |
| 33 | make && \ |
| 34 | make install && \ |
| 35 | ldconfig && \ |
| 36 | cd ../.. |
| 37 | |
| 38 | RUN rm -rf collocatordb |
| 39 | |
| 40 | # Install dependencies |
| 41 | RUN cpanm https://github.com/Akron/Mojolicious-Plugin-Localize.git && \ |
| 42 | cpanm --installdeps . |
| 43 | |
| 44 | |
| 45 | # Build derekovecs |
| 46 | RUN perl Makefile.PL && \ |
| 47 | make && \ |
| 48 | make install |
| 49 | |
| 50 | |
| 51 | ENV MOJO_CONFIG=/config/example.conf |
| 52 | |
| 53 | # RUN echo "{Kalamar=>{plugins=>['KorAPXML2Krill','Tei2KorAPXML']}}" > kalamar.production.conf |
| 54 | |
| 55 | EXPOSE 3000 |
| 56 | |
| 57 | ENTRYPOINT [ "hypnotoad", "-f", "script/derekovecs-server" ] |