From cdc73fe379512f2f889759d88b230559c4065c21 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Mon, 31 Oct 2022 16:34:42 +0300 Subject: [PATCH] Fix Bug 59481 - Fix errors when starting the container (#530) * Update the rabbitmq version * Fix incorrect replacement of worker_connections * Limiting the maximum number of simultaneous connections due to possible memory shortage --- Dockerfile | 3 ++- run-document-server.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ebd56d..55e4b6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ chmod 644 /etc/apt/trusted.gpg.d/onlyoffice.gpg && \ locale-gen en_US.UTF-8 && \ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ + wget -O - https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.deb.sh | bash && \ apt-get -yq install \ adduser \ apt-utils \ @@ -45,7 +46,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ postgresql \ postgresql-client \ pwgen \ - rabbitmq-server \ + rabbitmq-server=3.10* \ redis-server \ software-properties-common \ sudo \ diff --git a/run-document-server.sh b/run-document-server.sh index f290e8d..79404e6 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -73,7 +73,8 @@ NGINX_ONLYOFFICE_EXAMPLE_CONF="${NGINX_ONLYOFFICE_EXAMPLE_PATH}/includes/ds-exam NGINX_CONFIG_PATH="/etc/nginx/nginx.conf" NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} -NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} +# Limiting the maximum number of simultaneous connections due to possible memory shortage +[ $(ulimit -n) -gt 1048576 ] && NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-1048576} || NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} JWT_ENABLED=${JWT_ENABLED:-true}