blob: 417932ee3a44c2379dbdc7f42d07f29e9be67ecd [file] [log] [blame]
Marc Kupietza3774412022-06-10 21:46:22 +02001FROM metacpan/metacpan-api as builder
2
3# Copy repository respecting .dockerignore
4COPY . /derekovecs
5
6WORKDIR /derekovecs
7
8RUN apt update && apt -y install cmake libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev
9
10RUN git config --global user.email "korap+docker@ids-mannheim.de" && \
11 git config --global user.name "Docker"
12
13# Install RocksDB
14RUN 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
25RUN rm -rf rocksdb-5.11.3
26
27# Install collocatordb
28RUN 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
38RUN rm -rf collocatordb
39
40# Install dependencies
41RUN cpanm https://github.com/Akron/Mojolicious-Plugin-Localize.git && \
42 cpanm --installdeps .
43
44
45# Build derekovecs
46RUN perl Makefile.PL && \
47 make && \
48 make install
49
50
Marc Kupietza1f97022022-06-10 23:42:01 +020051ENV MOJO_CONFIG=/config/derekovecs.conf
Marc Kupietza3774412022-06-10 21:46:22 +020052
53EXPOSE 3000
54
55ENTRYPOINT [ "hypnotoad", "-f", "script/derekovecs-server" ]