Skip to content

Issues-519: Deploy Tideways deamon in Vanilla container #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ builddeploy_steps: &builddeploy_steps
- run: *install_dependency
- run: *install_deploysuite
#- restore_cache: *restore_cache_settings_for_build
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENVIRONMENT}
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENV}
#- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
Expand Down
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ ARG CI_DEPLOY_TOKEN
ARG VANILLA_VERSION=3.3
ARG ENV
ARG BRANCH
ARG TIDEWAYS_ENV

ENV TIDEWAYS_SERVICE web
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV
ENV TIDEWAYS_DAEMON_EXTRA="--env=$TIDEWAYS_ENVIRONMENT"
ENV WEB_DOCUMENT_ROOT /vanillapp

RUN echo "Tideways Daemon for '$TIDEWAYS_ENV' env"

# Get the latest release of Vanilla Forums
RUN wget https://github.com/vanilla/vanilla/releases/download/Vanilla_${VANILLA_VERSION}/vanilla-${VANILLA_VERSION}.zip
RUN unzip vanilla-${VANILLA_VERSION}.zip -d /tmp
Expand Down Expand Up @@ -74,14 +79,14 @@ RUN apt-get update && apt-get install -yq --no-install-recommends 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 && \
DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php tideways-daemon && \
apt-get autoremove --assume-yes && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini;
echo 'extension=tideways.so\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini;

# Copy custom supervisor's configs and scripts
# Netcat is used to connect to a memcached server
RUN apt-get update && apt-get install -y netcat
COPY ./services/flush_cache.conf /opt/docker/etc/supervisor.d/
COPY ./services/flush_cache.sh /opt/docker/bin/service.d/
COPY ./services /opt/docker/etc/supervisor.d/
COPY ./services /opt/docker/bin/service.d/
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ BRANCH=$4
TIDEWAYS_ENV=$5
UPDATE_CACHE=""
echo "" > vanilla.env
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml build $APP_NAME
#docker create --name app $APP_NAME:latest
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ services:
- VANILLA_VERSION=3.3
- CI_DEPLOY_TOKEN
- BRANCH
- TIDEWAYS_ENV
ports:
- 80:80
15 changes: 15 additions & 0 deletions services/tideways.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[group:tideways]
programs=tideways
priority=10

[program:tideways]
command=/opt/docker/bin/service.d/tideways.sh
process_name=%(program_name)s
startsecs=0
startretries=0
autostart=true
autorestart=false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
9 changes: 9 additions & 0 deletions services/tideways.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
echo tideways.sh: Tideways Daemon for $TIDEWAYS_ENVIRONMENT
/etc/init.d/tideways-daemon start
exit_code=$?
if [ $exit_code != 0 ]; then
echo tideways.sh: exit code $exit_code
else
echo tideways.sh: started successfully
fi