Skip to content

Commit

Permalink
Fix: docker-compose 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
deveunhwa committed Nov 5, 2024
1 parent c7053ac commit 1261339
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,22 @@ jobs:
sudo systemctl reload nginx
# Blue-Green 설정 Docker Compose 실행
- name: Deploy with Docker Compose on EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd ~/bitta-front
docker-compose down
docker-compose up -d
- name: Deploy with Docker Compose on EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd ~/bitta-project
docker-compose down
docker-compose up -d --no-deps
sudo nginx -s reload
# test
- name: Test Frontend Response
run: curl --fail http://${{ secrets.EC2_HOST }} || exit 1

- name: Test Backend Response
run: curl --fail http://${{ secrets.EC2_HOST }}/api/ || exit 1

22 changes: 17 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
version: '3'
services:
backend:
container_name: backend-blue
frontend-blue:
image: publicdeveh/bitta-front:latest
ports:
- "3001:3000"
environment:
- NODE_ENV=production

frontend-green:
image: publicdeveh/bitta-front:latest
ports:
- "3002:3000"
environment:
- NODE_ENV=production

backend-blue:
image: publicdeveh/bitta-kotlin:latest
ports:
- "8081:8000"
environment:
- SPRING_PROFILES_ACTIVE=prod

backend_alternate:
container_name: backend-green
backend-green:
image: publicdeveh/bitta-kotlin:latest
ports:
- "8082:8000"
environment:
- SPRING_PROFILES_ACTIVE=prod
- SPRING_PROFILES_ACTIVE=prod

0 comments on commit 1261339

Please sign in to comment.