@@ -3,7 +3,9 @@ FROM webdevops/php-apache
33ARG CI_DEPLOY_TOKEN
44ARG VANILLA_VERSION=3.3
55ARG ENV
6+ ARG BRANCH
67
8+ ENV TIDEWAYS_SERVICE vanilla
79ENV WEB_DOCUMENT_ROOT /vanillapp
810
911# Get the latest release of Vanilla Forums
@@ -14,33 +16,42 @@ RUN chmod -R 777 /vanillapp
1416
1517# Delete the auto-enabled 'stubcontent' plugin which adds stub contents
1618RUN rm -R /vanillapp/plugins/stubcontent
19+
20+ RUN echo "'$BRANCH' branch will be used for dependency repos ..."
21+
1722# Clone the forum-plugins repository
18- RUN git clone https://github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins
23+ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-plugins.git /tmp/forums-plugins
24+
25+ # Copy the Filestack plugin
26+ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack
27+
28+ # Copy the Groups plugin
29+ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups
30+
31+ # Copy the SumoLogic plugin
32+ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic
33+
34+ # Copy the TopcoderEditor plugin
35+ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor
36+
37+ # Copy the forum-theme repository
38+ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/topcoder
1939
2040# Remove DebugPlugin from PROD env
2141# RUN if [ "$ENV" = "prod" ]; \
2242# then rm -R /tmp/forums-plugins/DebugPlugin; \
2343# fi
2444
25- # Copy the Filestack plugin
26- RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-filestack-plugin /tmp/forums-plugins/Filestack
27-
28- # Copy the Groups plugin
29- RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-groups-plugin /tmp/forums-plugins/Groups
30-
31- # Copy the SumoLogic plugin
32- RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-sumologic-plugin /tmp/forums-plugins/Sumologic
33-
34- # Copy the TopcoderEditor plugin
35- RUN git clone https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-topcoder-editor-plugin /tmp/forums-plugins/TopcoderEditor
3645
3746# Copy all plugins to the Vanilla plugins folder
3847RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins
3948
40- # Get the debug bar plugin
41- RUN wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip
42- RUN unzip KSBIPJYMC0F2.zip
43- RUN cp -r debugbar /vanillapp/plugins
49+ # Get the debug bar plugin
50+ RUN if [ "$ENV" = "dev" ]; then \
51+ wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \
52+ unzip KSBIPJYMC0F2.zip; \
53+ cp -r debugbar /vanillapp/plugins; \
54+ fi
4455
4556# Install Topcoder dependencies
4657RUN composer install --working-dir /vanillapp/plugins/Topcoder
@@ -57,5 +68,17 @@ COPY ./vanilla/. /vanillapp/.
5768# Set permissions on config file
5869RUN chown application:application /vanillapp/conf/config.php
5970RUN chmod ug=rwx,o=rx /vanillapp/conf/config.php
60- # Clone the forum-theme repository
61- RUN git clone 'https://github.com/topcoder-platform/forums-theme.git' /vanillapp/themes/topcoder
71+
72+
73+ # Tideways
74+ RUN if [ "$ENV" = "dev" ]; then \
75+ apt-get update && apt-get install -y gnupg2; \
76+ echo 'deb https://packages.tideways.com/apt-packages debian main' > /etc/apt/sources.list.d/tideways.list && \
77+ curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \
78+ apt-get update && \
79+ DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php && \
80+ apt-get autoremove --assume-yes && \
81+ apt-get clean && \
82+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
83+ echo 'extension=tideways.so\n tideways.connection=tcp://tideways-daemon:9135\n tideways.enable_cli=0\n ' >> opt/docker/etc/php/php.ini; \
84+ fi
0 commit comments