From 1c2279ffdfb1b7175feb0aff7648e9e7518562ff Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Fri, 19 Feb 2021 12:19:17 +0300 Subject: [PATCH] Added Tideways --- Dockerfile | 26 +++++++++++++++++++++----- docker-compose.yml | 10 +++++++++- tideways-daemon/Dockerfile | 20 ++++++++++++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 tideways-daemon/Dockerfile diff --git a/Dockerfile b/Dockerfile index 51b07a8..053407f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ ARG CI_DEPLOY_TOKEN ARG VANILLA_VERSION=3.3 ARG ENV +# Environment Variables +ENV TIDEWAYS_SERVICE vanilla ENV WEB_DOCUMENT_ROOT /vanillapp # Get the latest release of Vanilla Forums @@ -20,24 +22,24 @@ RUN git clone https://github.com/topcoder-platform/forums-plugins.git /tmp/forum # Remove DebugPlugin from PROD env # RUN if [ "$ENV" = "prod" ]; \ # then rm -R /tmp/forums-plugins/DebugPlugin; \ -# fi +# fi # Copy the Filestack plugin RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack -#Copy the Groups plugin +# Copy the Groups plugin RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups -#Copy the SumoLogic plugin +# Copy the SumoLogic plugin RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic -#Copy the TopcoderEditor plugin +# Copy the TopcoderEditor plugin RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor # Copy all plugins to the Vanilla plugins folder RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins -#Get the debug bar plugin +# Get the debug bar plugin RUN wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip RUN unzip KSBIPJYMC0F2.zip RUN cp -r debugbar /vanillapp/plugins @@ -59,3 +61,17 @@ RUN chown application:application /vanillapp/conf/config.php RUN chmod ug=rwx,o=rx /vanillapp/conf/config.php # Clone the forum-theme repository RUN git clone 'https://github.com/topcoder-platform/forums-theme.git' /vanillapp/themes/topcoder + +# Tideways +RUN apt-get update && apt-get install -y gnupg2 +RUN echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \ + curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php && \ + apt-get autoremove --assume-yes && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# For customization a placeholder /opt/docker/etc/php/php.ini is available which will be loaded as last configuration file. +# All settings can be overwritten in this ini file +RUN echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\n' >> opt/docker/etc/php/php.ini diff --git a/docker-compose.yml b/docker-compose.yml index 7af8fc1..92ec070 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,5 +11,13 @@ services: - ENV - VANILLA_VERSION=3.3 - CI_DEPLOY_TOKEN + links: + - tideways-daemon ports: - - 80:80 \ No newline at end of file + - 80:80 + tideways-daemon: + container_name: tideways-daemon + build: + context: ./tideways-daemon + ports: + - 9135:9135 \ No newline at end of file diff --git a/tideways-daemon/Dockerfile b/tideways-daemon/Dockerfile new file mode 100644 index 0000000..3918cf7 --- /dev/null +++ b/tideways-daemon/Dockerfile @@ -0,0 +1,20 @@ +FROM debian:stable-slim + +ARG TIDEWAYS_ENVIRONMENT_DEFAULT=production +ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENVIRONMENT_DEFAULT + +RUN useradd --system tideways +RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2 curl sudo ca-certificates + +RUN echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \ + curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -yq tideways-daemon && \ + apt-get autoremove --assume-yes && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +EXPOSE 9135 + +USER tideways + +ENTRYPOINT ["tideways-daemon","--hostname=tideways-daemon","--address=0.0.0.0:9135"] \ No newline at end of file