Browse Source

Updating to Cutelyst 2.2.1 (#3689)

* cutelyst: Remove duplicated ENVs

* cutelyst: update to cutelyst 2.2.1

* Try to optimize cpu count

* cutelyst: Fix setting cpu count

* cutelyst: Update to v2.2.2 and get rid of duplicated and error prone build steps

* cutelyst: Add a README.md
Daniel Nicoletti 7 years ago
parent
commit
88180d6d3e

+ 13 - 0
frameworks/C++/cutelyst/README.md

@@ -0,0 +1,13 @@
+# Cutelyst 
+
+Cutelyst is a C++ Full Stack Web Framework built with Qt.
+
+Inspired on the Perl Catalyst Framework, it integrages with templating
+engines such as Grantlee (DJango syntax), ClearSilver. Many
+ready to use plugins to send templated emails, validade user input,
+CSRF protection, authentication and session increase the productivity
+while having very low memory requirements and a very good performance.
+
+Website: https://cutelyst.org
+GitHub: https://github.com/cutelyst/cutelyst
+

+ 42 - 0
frameworks/C++/cutelyst/build.sh

@@ -0,0 +1,42 @@
+#!/bin/bash
+
+export CUTELYST_VER=2.2.2
+
+export QT_VERSION_MM=59
+export QT_VERSION_FULL=594-xenial
+
+export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}
+
+echo ${CMAKE_PREFIX_PATH}/lib > /etc/ld.so.conf.d/qt${QT_VERSION_MM}.conf
+ldconfig
+
+apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
+    apt update -qq && \
+    apt install -yqq \
+    cmake \
+    clearsilver-dev \
+    libgrantlee5-dev \
+    libjemalloc-dev \
+    qt${QT_VERSION_MM}base \
+    qt${QT_VERSION_MM}script \
+    qt${QT_VERSION_MM}tools
+
+apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev nginx
+
+wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
+    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
+    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
+    cmake .. \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DPLUGIN_UWSGI=on \
+    -DPLUGIN_VIEW_GRANTLEE=on \
+    -DUSE_JEMALLOC=on && \
+    make && make install
+
+cd ${TROOT} && \
+    mkdir -p build && \
+    cd build && \
+    cmake ${TROOT} \
+    -DCMAKE_BUILD_TYPE=Release && \
+    make

+ 4 - 46
frameworks/C++/cutelyst/cutelyst-nginx-my.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,15 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
-RUN apt install -yqq nginx
-
 RUN sed -i "s|SendDate=.*|SendDate=false|g" /cutelyst_socket.ini
 
 ENV C_THREADS 1

+ 4 - 46
frameworks/C++/cutelyst/cutelyst-nginx-pg.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,15 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
-RUN apt install -yqq nginx
-
 RUN sed -i "s|SendDate=.*|SendDate=false|g" /cutelyst_socket.ini
 
 ENV C_THREADS 1

+ 4 - 46
frameworks/C++/cutelyst/cutelyst-nginx.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,15 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
-RUN apt install -yqq nginx
-
 RUN sed -i "s|SendDate=.*|SendDate=false|g" /cutelyst_socket.ini
 
 ENV C_THREADS 1

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-pf-my-nodelay.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_THREADS 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QMYSQL

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-pf-my.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_THREADS 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QMYSQL

+ 6 - 46
frameworks/C++/cutelyst/cutelyst-pf-nodelay.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,20 +37,13 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_THREADS 1
-ENV CPU_AFFINITY 1
+ENV CPU_AFFINITY 2
 
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
-    --processes=$(nproc) \
+    --processes=$(( ($(nproc) + 1) / 2 )) \
     --threads=${C_THREADS} \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-pf-pg-nodelay.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_THREADS 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QPSQL

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-pf-pg.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_THREADS 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QPSQL

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-thread-my-nodelay.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_PROCESSES 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QMYSQL

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-thread-my.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_PROCESSES 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QMYSQL

+ 6 - 46
frameworks/C++/cutelyst/cutelyst-thread-nodelay.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,21 +37,14 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_PROCESSES 1
-ENV CPU_AFFINITY 1
+ENV CPU_AFFINITY 2
 
 CMD cutelyst-wsgi2 \
     --ini /cutelyst.ini:uwsgi \
     --application ${CUTELYST_APP} \
     --processes=${C_PROCESSES} \
-    --threads=$(nproc) \
+    --threads=$(( (`nproc` + 1) / 2 )) \
     --cpu-affinity=${CPU_AFFINITY} \
     --socket-timeout 0 \
     --reuse-port \

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-thread-pg-nodelay.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_PROCESSES 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QPSQL

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-thread-pg.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_PROCESSES 1
 ENV CPU_AFFINITY 1
 ENV DRIVER QPSQL

+ 4 - 44
frameworks/C++/cutelyst/cutelyst-thread.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_PROCESSES 1
 ENV CPU_AFFINITY 1
 

+ 4 - 44
frameworks/C++/cutelyst/cutelyst.dockerfile

@@ -22,47 +22,14 @@ ENV LANGUAGE en_US:en
 ENV LC_ALL en_US.UTF-8
 ENV DEBIAN_FRONTEND noninteractive
 
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-ENV QT_VERSION_MM 59
-ENV QT_VERSION_FULL 594-xenial
-ENV CMAKE_PREFIX_PATH /opt/qt${QT_VERSION_MM}
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
-
-RUN apt-add-repository --yes ppa:beineri/opt-qt$QT_VERSION_FULL && \
-    apt update -qq && \
-    apt install -yqq \
-    cmake \
-    clearsilver-dev \
-    libgrantlee5-dev \
-    libjemalloc-dev \
-    qt${QT_VERSION_MM}base \
-    qt${QT_VERSION_MM}script \
-    qt${QT_VERSION_MM}tools
-
-RUN apt install -yqq uwsgi uwsgi uuid-dev libcap-dev libzmq3-dev
-
-ENV CUTELYST_VER 2.0.1
-
-RUN wget -q https://github.com/cutelyst/cutelyst/archive/v$CUTELYST_VER.tar.gz -O cutelyst-$CUTELYST_VER.tar.gz && \
-    tar zxf cutelyst-$CUTELYST_VER.tar.gz && \
-    cd cutelyst-$CUTELYST_VER && mkdir build && cd build && \
-    cmake .. \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DPLUGIN_UWSGI=on \
-    -DPLUGIN_VIEW_GRANTLEE=on \
-    -DUSE_JEMALLOC=on && \
-    make && make install
-
 ENV TROOT /cutelyst-benchmark-app
-ENV LD_LIBRARY_PATH ${CMAKE_PREFIX_PATH}/lib
 ENV CUTELYST_APP ${TROOT}/build/libcutelyst_benchmarks.so
 
 COPY src ${TROOT}/
+
+COPY build.sh .
+RUN ./build.sh
+
 COPY config/config.ini /cutelyst.ini
 COPY config/config_socket.ini /cutelyst_socket.ini
 COPY nginx.conf /nginx.conf
@@ -70,13 +37,6 @@ COPY nginx.conf /nginx.conf
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst.ini
 RUN sed -i "s|DatabaseHostName=.*|DatabaseHostName=tfb-database|g" /cutelyst_socket.ini
 
-RUN cd ${TROOT} && \
-    mkdir -p build && \
-    cd build && \
-    cmake ${TROOT} \
-    -DCMAKE_BUILD_TYPE=Release && \
-    make
-
 ENV C_THREADS 1
 ENV CPU_AFFINITY 1