Skip to content
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
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG CI_DEPLOY_TOKEN
ARG VANILLA_VERSION=3.3
ARG ENV

ENV TIDEWAYS_SERVICE vanilla
ENV WEB_DOCUMENT_ROOT /vanillapp

# Get the latest release of Vanilla Forums
Expand Down Expand Up @@ -59,3 +60,16 @@ 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 if [ "$ENV" = "dev" ]; then \
apt-get update && apt-get install -y gnupg2; \
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/*; \
echo 'extension=tideways.so\ntideways.connection=tcp://tideways-daemon:9135\ntideways.enable_cli=0\n' >> opt/docker/etc/php/php.ini; \
fi
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ CI_DEPLOY_TOKEN=$2
ENV=$3
UPDATE_CACHE=""
echo "" > vanilla.env
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN docker-compose -f docker-compose.yml build $APP_NAME
if [ "$ENV" = "dev" ]; then
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
else
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN docker-compose -f docker-compose.yml build $APP_NAME
fi
#docker create --name app $APP_NAME:latest
3 changes: 1 addition & 2 deletions config/vanilla/bootstrap.before.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ function watchButton($categoryID) {
* @return bool return true if user has a permission
*/
function checkGroupPermission($userID,$groupID, $categoryID = null , $permissionCategoryID = null , $permission = null, $fullMatch = true) {
$groupModel = new GroupModel();
return $groupModel->checkPermission($userID,$groupID, $categoryID,$permissionCategoryID , $permission, $fullMatch);
return GroupModel::checkPermission($userID,$groupID, $categoryID,$permissionCategoryID , $permission, $fullMatch);
}
}

Expand Down
22 changes: 6 additions & 16 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
version: '3'
services:
mysql-local:
image: mysql
container_name: mysql-local
ports:
- 3306:3306
env_file:
- ./mysql.env
security_opt:
- seccomp:unconfined
command: --default-authentication-plugin=mysql_native_password
vanilla-forums:
links:
- mysql-local
- memcached-local
memcached-local:
image: memcached:1.5
container_name: memcached-local
- tideways-daemon
tideways-daemon:
container_name: tideways-daemon
build:
context: ./tideways-daemon
ports:
- "11211:11211"
- 9135:9135
21 changes: 21 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'
services:
mysql-local:
image: mysql
container_name: mysql-local
ports:
- 3306:3306
env_file:
- ./mysql.env
security_opt:
- seccomp:unconfined
command: --default-authentication-plugin=mysql_native_password
vanilla-forums:
links:
- mysql-local
- memcached-local
memcached-local:
image: memcached:1.5
container_name: memcached-local
ports:
- "11211:11211"
20 changes: 20 additions & 0 deletions tideways-daemon/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
Loading