From 62424ea12059e2afb1b3d196b6cd25a2b00c425f Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Thu, 4 Jun 2020 15:15:34 +0300 Subject: [PATCH] Disable redis server for Community Edition (#255) * Disable redis server * Add REDIS_ENABLED variable * Fix Dockerfile * Fix REDIS_ENABLED condition --- Dockerfile | 3 ++- run-document-server.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d996e71..5585e64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,7 +67,8 @@ ARG REPO_URL="deb http://download.onlyoffice.com/repo/debian squeeze main" ARG COMPANY_NAME=onlyoffice ARG PRODUCT_NAME=documentserver -ENV COMPANY_NAME=$COMPANY_NAME +ENV COMPANY_NAME=$COMPANY_NAME \ + PRODUCT_NAME=$PRODUCT_NAME RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/ds.list && \ apt-get -y update && \ diff --git a/run-document-server.sh b/run-document-server.sh index b040372..4a689bb 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -49,6 +49,12 @@ JWT_SECRET=${JWT_SECRET:-secret} JWT_HEADER=${JWT_HEADER:-Authorization} JWT_IN_BODY=${JWT_IN_BODY:-false} +if [[ ${PRODUCT_NAME} == "documentserver" ]]; then + REDIS_ENABLED=false +else + REDIS_ENABLED=true +fi + ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/local.json ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json ONLYOFFICE_EXAMPLE_CONFIG=${CONF_DIR}-example/local.json @@ -461,7 +467,7 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then if [ ${REDIS_SERVER_HOST} != "localhost" ]; then update_redis_settings - else + elif [ ${REDIS_ENABLED} = "true" ]; then # change rights for redis directory chown -R redis:redis ${REDIS_DATA} chmod -R 750 ${REDIS_DATA} @@ -492,7 +498,9 @@ fi if [ ${ONLYOFFICE_DATA_CONTAINER} != "true" ]; then waiting_for_db waiting_for_amqp - waiting_for_redis + if [ ${REDIS_ENABLED} = "true" ]; then + waiting_for_redis + fi update_nginx_settings