Merge pull request #4459 from nextcloud/enh/noid/add-redis-to-dockerfile

nextcloud container - add redis session handler to Dockerfile
This commit is contained in:
Simon L 2024-03-28 12:42:40 +01:00 committed by GitHub
commit a05269c773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View file

@ -117,6 +117,14 @@ RUN set -ex; \
echo 'max_input_time=${PHP_MAX_TIME}'; \ echo 'max_input_time=${PHP_MAX_TIME}'; \
} > /usr/local/etc/php/conf.d/nextcloud.ini; \ } > /usr/local/etc/php/conf.d/nextcloud.ini; \
\ \
{ \
echo 'session.save_handler = redis'; \
echo 'session.save_path = "tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}"'; \
echo 'redis.session.locking_enabled = 1'; \
echo 'redis.session.lock_retries = -1'; \
echo 'redis.session.lock_wait_time = 10000'; \
} > /usr/local/etc/php/conf.d/redis-session.ini; \
\
mkdir -p /var/www/data; \ mkdir -p /var/www/data; \
chown -R www-data:root /var/www; \ chown -R www-data:root /var/www; \
chmod -R g=u /var/www; \ chmod -R g=u /var/www; \

View file

@ -19,17 +19,6 @@ run_upgrade_if_needed_due_to_app_update() {
fi fi
} }
echo "Configuring Redis as session handler..."
cat << REDIS_CONF > /usr/local/etc/php/conf.d/redis-session.ini
session.save_handler = redis
session.save_path = "tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}?auth=${REDIS_HOST_PASSWORD}"
redis.session.locking_enabled = 1
redis.session.lock_retries = -1
# redis.session.lock_wait_time is specified in microseconds.
# Wait 10ms before retrying the lock rather than the default 2ms.
redis.session.lock_wait_time = 10000
REDIS_CONF
# Check permissions in ncdata # Check permissions in ncdata
touch "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" &>/dev/null touch "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" &>/dev/null
if ! [ -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" ]; then if ! [ -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" ]; then