From 0c4ff1283cc588beea9109e5ca1049dc700dfb5c Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Sun, 2 Nov 2025 22:48:10 +0100 Subject: [PATCH] fix: Add workaround for REDIS_PASSWORD_FILE not being set by Docker Compose - Manually set REDIS_PASSWORD_FILE if file exists but variable is not set - Handles cases where Docker Compose doesn't set the variable correctly - Should fix issue where REDIS_PASSWORD_FILE is missing even though configured --- src/Framework/Core/AppBootstrapper.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Framework/Core/AppBootstrapper.php b/src/Framework/Core/AppBootstrapper.php index c4e64e61..110e7aa4 100644 --- a/src/Framework/Core/AppBootstrapper.php +++ b/src/Framework/Core/AppBootstrapper.php @@ -50,6 +50,14 @@ final readonly class AppBootstrapper // Initialize environment with encryption support $env = $this->initializeEnvironment(); + + // Workaround: If REDIS_PASSWORD_FILE is not set but expected file exists, set it manually + // This handles cases where Docker Compose doesn't set the variable correctly + $expectedRedisPasswordFile = '/run/secrets/redis_password'; + if (!$env->has('REDIS_PASSWORD_FILE') && file_exists($expectedRedisPasswordFile)) { + // Add REDIS_PASSWORD_FILE to environment if file exists + $env = $env->withVariable('REDIS_PASSWORD_FILE', $expectedRedisPasswordFile); + } error_log("------ ENVIRONMENT VARIABLES ------"); error_log(print_r($env->all(true), true));