diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index ce108589..24beac3c 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -208,7 +208,7 @@ RUN set -ex; \ RUN set -ex; \ grep -q '^pm = dynamic' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm = dynamic/pm = ondemand/' /usr/local/etc/php-fpm.d/www.conf; \ - sed -i 's/^pm.max_children =.*/pm.max_children = ${PHP_MAX_CHILDREN}/' /usr/local/etc/php-fpm.d/www.conf; \ + sed -i 's/^pm.max_children =.*/pm.max_children = 80/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm.start_servers =.*/pm.start_servers = 2/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm.min_spare_servers =.*/pm.min_spare_servers = 1/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's/^pm.max_spare_servers =.*/pm.max_spare_servers = 3/' /usr/local/etc/php-fpm.d/www.conf @@ -224,6 +224,7 @@ RUN set -ex; \ RUN set -ex; \ chown www-data:root -R /usr/src && \ chown www-data:root -R /usr/local/etc/php/conf.d && \ + chown www-data:root /usr/local/etc/php-fpm.d/www.conf && \ chown www-data:root -R /var/log/supervisord/ && \ chown www-data:root -R /var/run/supervisord/ && \ rm -r /usr/src/nextcloud/apps/updatenotification diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index c1d4aacd..94ad9d12 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -24,7 +24,9 @@ REDIS_CONF echo "Setting php max children..." MEMORY=$(mawk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo) PHP_MAX_CHILDREN=$((MEMORY/50)) -export PHP_MAX_CHILDREN +if [ -n "$PHP_MAX_CHILDREN" ]; then + sed -i "s/^pm.max_children =.*/pm.max_children = $PHP_MAX_CHILDREN/" /usr/local/etc/php-fpm.d/www.conf +fi # Check permissions in ncdata touch "/mnt/ncdata/this-is-a-test-file" diff --git a/Containers/postgresql/start.sh b/Containers/postgresql/start.sh index 6d140fdb..b2e25a1b 100644 --- a/Containers/postgresql/start.sh +++ b/Containers/postgresql/start.sh @@ -113,7 +113,9 @@ fi echo "Setting max connections..." MEMORY=$(mawk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo) MAX_CONNECTIONS=$((MEMORY/50+3)) -sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf" +if [ -n "$MAX_CONNECTIONS" ]; then + sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf" +fi # Catch docker stop attempts trap 'true' SIGINT SIGTERM