FROM ubuntu:18.04

ENV TZ=Europe/Berlin

USER root

RUN sed -i 's/#.*deb-src/deb-src/g' /etc/apt/sources.list

RUN apt update && DEBIAN_FRONTEND="noninteractive" apt build-dep pokerth -y && apt install -y \
    libmysql++-dev qt5-default git ca-certificates dumb-init \
    && apt clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /opt && git clone https://github.com/pokerth/pokerth.git && cd pokerth && git checkout stable && \
    qmake CONFIG+="official_server  c++11" QMAKE_CFLAGS_ISYSTEM="" -spec linux-g++ pokerth.pro && make

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "-c", "tail -f /root/.pokerth/log-files/server_messages.log"]
