diff --git a/src/main/java/com/example/postgresdemo/Service/RedisConfig.java b/src/main/java/com/example/postgresdemo/Service/RedisConfig.java index 8e1d4e6..be46afa 100644 --- a/src/main/java/com/example/postgresdemo/Service/RedisConfig.java +++ b/src/main/java/com/example/postgresdemo/Service/RedisConfig.java @@ -12,7 +12,11 @@ public class RedisConfig { public JedisPool jedisPool() { JedisPoolConfig config = new JedisPoolConfig(); config.setMaxTotal(8); - config.setJmxEnabled(false); // <-- Это отключает регистрацию MBean - return new JedisPool(config, "localhost", 6379); + config.setJmxEnabled(false); + + String redisHost = System.getenv("REDIS_HOST"); + int redisPort = Integer.parseInt(System.getenv("REDIS_PORT")); + + return new JedisPool(config, redisHost, redisPort); } }