File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments