FROM ubuntu:focal-20240530
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Moscow"
WORKDIR /app
RUN apt update && apt install git cmake python3-venv postgresql libpq-dev libev-dev libyaml-cpp-dev lld openssl libboost-all-dev gcc g++ postgresql pkg-config build-essential libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libboost-filesystem-dev  -y 
RUN apt install libssl-dev openssl libcrypto++-dev wget ccache libhttp-parser-dev libc-ares-dev libnghttp2-dev golang fmtools libc-ares2 libcctz-dev libssh2-1-dev libfmt-dev -y
COPY ./ /app/
RUN wget https://github.com/fmtlib/fmt/archive/refs/tags/10.2.1.tar.gz && \
    tar -xzf 10.2.1.tar.gz && \
    cd fmt-10.2.1 && \
    mkdir build && cd build && \
    cmake .. && \
    make -j$(nproc) && \
    make install && cd /app/ && rm -rf fmt-10.2.1/ && rm 10.2.1.tar.gz
RUN git submodule init && git submodule update
RUN cmake -B build-dir -DCMAKE_BUILD_TYPE=Release
RUN /usr/bin/cmake --build build-dir/ -j 4
CMD /app/build-dir/log_analysis/server/la_server  --config configuration.yaml --config_vars configuration_vars.yaml
