blob: 93f9a074e2a7f05590b6a299b56bc96a198a5248 [file] [log] [blame]
Marc Kupietz90265672024-08-27 19:51:15 +02001FROM metacpan/metacpan-api AS builder
Marc Kupietza3774412022-06-10 21:46:22 +02002
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
Marc Kupietz7effa3e2024-08-28 16:01:09 +020050RUN rm -rf example-models
Marc Kupietza3774412022-06-10 21:46:22 +020051
Marc Kupietza1f97022022-06-10 23:42:01 +020052ENV MOJO_CONFIG=/config/derekovecs.conf
Marc Kupietza3774412022-06-10 21:46:22 +020053
54EXPOSE 3000
55
56ENTRYPOINT [ "hypnotoad", "-f", "script/derekovecs-server" ]