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
This commit is contained in:
@@ -51,6 +51,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));
|
||||
error_log("------------------------------------");
|
||||
|
||||
Reference in New Issue
Block a user