Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: CI/CD Docker to EC2
# 언제 이 워크플로우를 실행할지 정하는 부분임.
on:
push:
# "refactor/deployment" 브랜치에 코드가 push 될 때마다 실행될 거임.
branches: [ "refactor/deployment" ]
# "refactor/redis" 브랜치에 코드가 push 될 때마다 실행될 거임.
branches: [ "refactor/redis" ]

# 워크플로우가 해야 할 작업(job)들을 정의함.
jobs:
Expand Down
29 changes: 29 additions & 0 deletions database/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# db 용 docker-compose.yml

version: '3.8'

services:
redis:
# 사용할 이미지
image: redis:latest
# 컨테이너명
container_name: redis-container
# 접근 포트 설정(컨테이너 외부:컨테이너 내부)
ports:
- "6379:6379"
# 스토리지 마운트(볼륨) 설정
volumes:
- /home/ubuntu/db/redis/data:/data
- /home/ubuntu/db/redis/conf/redis.conf:/usr/local/conf/redis.conf
# 컨테이너에 docker label을 이용해서 메타데이터 추가
labels:
- "name=redis"
- "mode=standalone"
# 컨테이너 종료시 재시작 여부 설정
restart: always
command: redis-server /usr/local/conf/redis.conf

networks:
default:
external: true
name: my-network
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
# application-prod.yml 파일을 활성화 시킴
environment:
SPRING_PROFILES_ACTIVE: prod
SPRING_REDIS_HOST: redis-container
SPRING_REDIS_PORT: 6379
# docker 컨테이너가 중단되었을때 다시 자동으로 자동 재시작 하지 않음
restart: "no"
volumes:
Expand Down