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
2 changes: 1 addition & 1 deletion backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
# Nginx λ‘œλ“œ λ°ΈλŸ°μ„œ
nginx:
image: nginx:alpine
container_name: nginx-lb
container_name: nginx
ports:
- "80:80"
volumes:
Expand Down
19 changes: 16 additions & 3 deletions backend/scripts/blue-green-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,32 @@ health_check() {
return 1
}

# Nginx μ‹œμž‘ ν•¨μˆ˜
start_nginx_if_needed() {
if ! docker ps | grep -q "nginx"; then
echo "🌐 Nginx λ‘œλ“œ λ°ΈλŸ°μ„œ μ‹œμž‘..."
docker-compose -f docker-compose.yml up -d nginx
else
echo "βœ… Nginx λ‘œλ“œ λ°ΈλŸ°μ„œκ°€ 이미 μ‹€ν–‰ μ€‘μž…λ‹ˆλ‹€."
fi
}

# Nginx μ‹œμž‘ 확인 (ν•œ 번만)
start_nginx_if_needed

# μ»¨ν…Œμ΄λ„ˆ μŠ€μœ„μΉ­
if [ -z "$EXIST_BLUE" ]; then
echo "οΏ½ Blue ν™˜κ²½μœΌλ‘œ λ°°ν¬ν•©λ‹ˆλ‹€..."
echo "πŸ”΅ Blue ν™˜κ²½μœΌλ‘œ λ°°ν¬ν•©λ‹ˆλ‹€..."

# Blue ν™˜κ²½ μ‹œμž‘
docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.yml up -d fastapi-blue nginx-lb
docker-compose -p ${DOCKER_APP_NAME}-blue -f docker-compose.yml up -d fastapi-blue
BEFORE_COMPOSE_COLOR="green"
AFTER_COMPOSE_COLOR="blue"
else
echo "🟒 Green ν™˜κ²½μœΌλ‘œ λ°°ν¬ν•©λ‹ˆλ‹€..."

# Green ν™˜κ²½ μ‹œμž‘
docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.yml up -d fastapi-green nginx-lb
docker-compose -p ${DOCKER_APP_NAME}-green -f docker-compose.yml up -d fastapi-green
BEFORE_COMPOSE_COLOR="blue"
AFTER_COMPOSE_COLOR="green"
fi
Expand Down
Loading