From 86feddb8bc8fceb938d736d19406e80acffa2822 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sat, 6 Jul 2024 14:37:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EB=A0=88=EB=94=94=EC=8A=A4=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layer-api/infra/development/docker-compose.yaml | 8 -------- layer-api/src/main/java/org/layer/config/RedisConfig.java | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/layer-api/infra/development/docker-compose.yaml b/layer-api/infra/development/docker-compose.yaml index 3c79516c..c5474b18 100644 --- a/layer-api/infra/development/docker-compose.yaml +++ b/layer-api/infra/development/docker-compose.yaml @@ -1,12 +1,4 @@ services: - redis: - image: redis:latest - container_name: redis - ports: - - "6379:6379" - networks: - - app-network - java-app: image: ghcr.io/depromeet/kasukabe-server/layer-api:latest container_name: layer-api diff --git a/layer-api/src/main/java/org/layer/config/RedisConfig.java b/layer-api/src/main/java/org/layer/config/RedisConfig.java index f1a91e6d..1a96f9c4 100644 --- a/layer-api/src/main/java/org/layer/config/RedisConfig.java +++ b/layer-api/src/main/java/org/layer/config/RedisConfig.java @@ -5,6 +5,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisStandaloneConfiguration; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; @@ -20,8 +21,15 @@ public class RedisConfig { @Value("${spring.data.redis.port}") private int port; + @Value("${spring.data.redis.password}") + private String password; + @Bean public RedisConnectionFactory redisConnectionFactory() { + RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(); + redisStandaloneConfiguration.setHostName(host); + redisStandaloneConfiguration.setPort(port); + redisStandaloneConfiguration.setPassword(password); return new LettuceConnectionFactory(host, port); }