Skip to content

Commit a069adf

Browse files
committed
refactor: CI/CD 스크립트 수정
1 parent 2f465e6 commit a069adf

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/dev_deploy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ jobs:
4040
target: "/home/${{ secrets.EC2_USERNAME }}/" # EC2 인스턴스의 홈 디렉토리
4141
strip_components: 2 # JAR 파일만 복사하기 위해 상위 경로(build/libs/) 제거
4242

43+
# docker-compose-dev.yml 파일을 EC2로 복사
44+
- name: Copy docker-compose.yml to EC2
45+
uses: appleboy/[email protected] # scp-action을 사용하여 파일을 EC2로 복사
46+
with:
47+
host: ${{ secrets.EC2_HOST }}
48+
username: ${{ secrets.EC2_USERNAME }}
49+
key: ${{ secrets.EC2_PRIVATE_KEY }}
50+
source: "docker-compose.yml" # Runner의 현재 작업 디렉토리에 있는 파일
51+
target: "/home/ubuntu/" # EC2 인스턴스의 대상 디렉토리 (파일이 복사될 위치)
52+
4353
# 6. EC2에 배포 및 애플리케이션 실행
4454
- name: Deploy to EC2
4555
uses: appleboy/ssh-action@master

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.8' # Docker Compose 파일 버전
2+
3+
services:
4+
# Redis 서비스
5+
redis:
6+
image: "redis:latest" # Docker Hub의 최신 Redis 이미지를 사용합니다.
7+
container_name: withmorning-redis # 컨테이너 이름을 지정합니다.
8+
ports:
9+
- "6379:6379" # 호스트와 컨테이너의 Redis 포트를 연결합니다.
10+
#서버가 재시작되어도 Redis 데이터가 유지되도록 볼륨을 설정할 수 있습니다. (선택 사항)
11+
volumes:
12+
- redis-data:/data
13+

0 commit comments

Comments
 (0)