make redis port configurable

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2025-12-08 15:36:02 +01:00
parent cd8158c9f6
commit 1691a19036
7 changed files with 15 additions and 10 deletions

View file

@ -138,7 +138,7 @@ RUN set -ex; \
\
{ \
echo 'session.save_handler = redis'; \
echo 'session.save_path = "tcp://${REDIS_HOST}:6379?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}"'; \
echo 'session.save_path = "tcp://${REDIS_HOST}:${REDIS_PORT}?database=${REDIS_DB_INDEX}${REDIS_USER_AUTH}&auth[]=${REDIS_HOST_PASSWORD}"'; \
echo 'redis.session.locking_enabled = 1'; \
echo 'redis.session.lock_retries = -1'; \
echo 'redis.session.lock_wait_time = 10000'; \

View file

@ -9,10 +9,8 @@ if (getenv('REDIS_HOST')) {
),
);
if (getenv('REDIS_HOST_PORT')) {
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
} elseif (getenv('REDIS_HOST')[0] != '/') {
$CONFIG['redis']['port'] = 6379;
if (getenv('REDIS_PORT')) {
$CONFIG['redis']['port'] = (int) getenv('REDIS_PORT');
}
if (getenv('REDIS_DB_INDEX')) {

View file

@ -27,7 +27,7 @@ fi
# Only start container if Redis is accessible
# shellcheck disable=SC2153
while ! nc -z "$REDIS_HOST" "6379"; do
while ! nc -z "$REDIS_HOST" "$REDIS_PORT"; do
echo "Waiting for Redis to start..."
sleep 5
done