From ed0b339dc9d149bb542f1151114975c2437f01d7 Mon Sep 17 00:00:00 2001 From: ht3064 <145987233+ht3064@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:50:25 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20Redis=EB=A5=BC=20AWS=20ElastiCache?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=84=ED=99=98=20(#138)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: aws elasticache 도입으로 인한 docker-compose.yml 삭제 * fix: redis.yml 파일 수정 * fix: task-definition.json 파일에 Redis 컨테이너 삭제 및 환경 변수 추가 * fix: Redis Config 수정 --- docker-compose.yml | 14 -------- .../infra/config/redis/RedisConfig.java | 3 +- src/main/resources/application-redis.yml | 6 ++-- task-definition.json | 33 ++++--------------- 4 files changed, 10 insertions(+), 46 deletions(-) delete mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 9de8ee0..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -services: - springboot: - image: 122971469363.dkr.ecr.ap-northeast-2.amazonaws.com/pickle:latest - container_name: pickle-container - build: - context: . - dockerfile: ./Dockerfile - depends_on: - - redis - redis: - image: redis:alpine - container_name: redis - ports: - - "6379:6379" \ No newline at end of file diff --git a/src/main/java/com/api/pickle/infra/config/redis/RedisConfig.java b/src/main/java/com/api/pickle/infra/config/redis/RedisConfig.java index d3817f4..0fcc975 100644 --- a/src/main/java/com/api/pickle/infra/config/redis/RedisConfig.java +++ b/src/main/java/com/api/pickle/infra/config/redis/RedisConfig.java @@ -14,8 +14,7 @@ import java.time.Duration; -@EnableRedisRepositories( - enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP) +@EnableRedisRepositories @Configuration @RequiredArgsConstructor public class RedisConfig { diff --git a/src/main/resources/application-redis.yml b/src/main/resources/application-redis.yml index 778feec..c4fe1ed 100644 --- a/src/main/resources/application-redis.yml +++ b/src/main/resources/application-redis.yml @@ -4,6 +4,6 @@ spring: on-profile: "redis" data: redis: - host: ${REDIS_HOST:localhost} - port: ${REDIS_HOST:6379} - password: ${REDIS_PASSWORD:} \ No newline at end of file + host: ${REDIS_HOST} + port: ${REDIS_PORT} + password: ${REDIS_PASSWORD} \ No newline at end of file diff --git a/task-definition.json b/task-definition.json index 01279aa..61d8d05 100644 --- a/task-definition.json +++ b/task-definition.json @@ -98,37 +98,16 @@ { "name": "FCM_CERTIFICATION", "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:122971469363:secret:playauto/gmp-2dXhTZ:FCM_CERTIFICATION::" - } - ], - "ulimits": [], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": "/ecs/pickle-family", - "awslogs-create-group": "true", - "awslogs-region": "ap-northeast-2", - "awslogs-stream-prefix": "ecs" }, - "secretOptions": [] - }, - "systemControls": [] - }, - { - "name": "redis", - "image": "redis:alpine", - "cpu": 0, - "portMappings": [ { - "containerPort": 6379, - "hostPort": 6379, - "protocol": "tcp" + "name": "REDIS_HOST", + "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:122971469363:secret:playauto/gmp-2dXhTZ:REDIS_HOST::" + }, + { + "name": "REDIS_PORT", + "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:122971469363:secret:playauto/gmp-2dXhTZ:REDIS_PORT::" } ], - "essential": true, - "environment": [], - "environmentFiles": [], - "mountPoints": [], - "volumesFrom": [], "ulimits": [], "logConfiguration": { "logDriver": "awslogs",