Add Dockerfile

Change-Id: I1160c014bca9f4dbff8da2dadcbde5d91eabaef0
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..d68d7f5
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,57 @@
+FROM metacpan/metacpan-api as builder
+
+# Copy repository respecting .dockerignore
+COPY . /derekovecs
+
+WORKDIR /derekovecs
+
+RUN apt update && apt -y install cmake libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev
+
+RUN git config --global user.email "korap+docker@ids-mannheim.de" && \
+    git config --global user.name "Docker"
+
+# Install RocksDB
+RUN curl -L https://github.com/facebook/rocksdb/archive/refs/tags/v5.11.3.tar.gz | tar zx && \
+    cd rocksdb-5.11.3 && \
+    export PROCS=$(nproc) && \
+    make -j $PROCS static_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \
+    make install-static DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \
+    make -j $PROCS shared_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \
+    make install-shared DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w && \
+    ldconfig && \
+    cd ..
+
+
+RUN rm -rf rocksdb-5.11.3
+
+# Install collocatordb
+RUN git clone "https://korap.ids-mannheim.de/gerrit/ids-kl/collocatordb" && \
+    cd collocatordb && \
+    mkdir -p build && \
+    cd build && \
+    cmake .. && \
+    make && \
+    make install && \
+    ldconfig && \
+    cd ../..
+
+RUN rm -rf collocatordb
+
+# Install dependencies
+RUN cpanm https://github.com/Akron/Mojolicious-Plugin-Localize.git && \
+    cpanm --installdeps .
+
+
+# Build derekovecs
+RUN perl Makefile.PL && \
+    make && \
+    make install
+
+
+ENV MOJO_CONFIG=/config/example.conf
+
+# RUN echo "{Kalamar=>{plugins=>['KorAPXML2Krill','Tei2KorAPXML']}}" > kalamar.production.conf
+
+EXPOSE 3000
+
+ENTRYPOINT [ "hypnotoad", "-f", "script/derekovecs-server" ]