From 94a747f61e97944865c22e851cf03a3ed1f8cb49 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Thu, 23 May 2024 16:29:55 +0200 Subject: [PATCH] Use REDIS_URL to set up the cache plugin (#539) --- docker-compose.yaml | 1 + setup.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 8df9bddd..7cb47277 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,6 +18,7 @@ services: # Default: amd64 # Possible values: amd64 or arm64 - ARCH=amd64 + - REDIS_URL=redis://redis:6379/0 postgres: image: postgres:latest environment: diff --git a/setup.sh b/setup.sh index 139cd481..7948a4ad 100755 --- a/setup.sh +++ b/setup.sh @@ -63,6 +63,8 @@ echo "Installing GatewayD plugins..." "${GATEWAYD_FILES}"/gatewayd plugin install --skip-path-slip-verification --output-dir "${GATEWAYD_FILES}" --plugin-config "${GATEWAYD_FILES}"/gatewayd_plugins.yaml --cleanup=false --update --overwrite-config || exit 126 # Replace the default Redis URL with the Redis container URL -sed -i 's/redis:\/\/localhost:6379/redis:\/\/redis:6379/' "${GATEWAYD_FILES}"/gatewayd_plugins.yaml +[ -z "${REDIS_URL}" ] && REDIS_URL="redis://redis:6379/0" && export REDIS_URL +echo "Setting Redis URL to ${REDIS_URL}" +sed -i "s#redis://localhost:6379/0#${REDIS_URL}#" "${GATEWAYD_FILES}"/gatewayd_plugins.yaml echo "GatewayD ${GATEWAYD_VERSION} and plugins installed successfully. Exiting..."