Skip to content

Commit

Permalink
๐Ÿ› bugfix: Docker์— ์˜ํ•œ Redis ์„ค์ • ์˜ค๋ฅ˜ ํ•ด๊ฒฐ
Browse files Browse the repository at this point in the history
  • Loading branch information
jun02160 committed Mar 2, 2024
1 parent a75bcf4 commit d178311
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/batch-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: # ํŠธ๋ฆฌ๊ฑฐ
push:
branches: [ "develop" ]
paths:
- motivoo-api/**
- motivoo-batch/**
- motivoo-domain/**
- motivoo-common/**
- motivoo-external/**
Expand Down
26 changes: 13 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ services:
image: redis:alpine
ports:
- "6379:6379"
networks:
- motivoo-net
# networks:
# - motivoo-net

blue-api:
container_name: blue-api
Expand All @@ -19,8 +19,8 @@ services:
- TZ=Asia/Seoul
depends_on:
- redis
networks:
- motivoo-net
# networks:
# - motivoo-net

blue-batch:
container_name: blue-batch
Expand All @@ -31,8 +31,8 @@ services:
- "8081:8081"
environment:
- TZ=Asia/Seoul
networks:
- motivoo-net
# networks:
# - motivoo-net


green-api:
Expand All @@ -46,8 +46,8 @@ services:
- TZ=Asia/Seoul
depends_on:
- redis
networks:
- motivoo-net
# networks:
# - motivoo-net

green-batch:
container_name: green-batch
Expand All @@ -58,9 +58,9 @@ services:
- "8083:8081"
environment:
- TZ=Asia/Seoul
networks:
- motivoo-net
# networks:
# - motivoo-net

networks:
motivoo-net:
driver: bridge
#networks:
# motivoo-net:
# driver: bridge
2 changes: 1 addition & 1 deletion scripts/api/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NOW_TIME="$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S

ALL_PORTS=("8080","8082")
AVAILABLE_PORT=()
SERVER_NAME=motivoo-server
SERVER_NAME=motivoo-api-server

DOCKER_PS_OUTPUT=$(docker ps | grep $SERVER_NAME)
RUNNING_CONTAINER_NAME=$(echo "$DOCKER_PS_OUTPUT" | awk '{print $NF}')
Expand Down
11 changes: 1 addition & 10 deletions scripts/batch/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NOW_TIME="$(date +%Y)-$(date +%m)-$(date +%d) $(date +%H):$(date +%M):$(date +%S

ALL_PORTS=("8081","8083")
AVAILABLE_PORT=()
SERVER_NAME=motivoo-server
SERVER_NAME=motivoo-batch-server

DOCKER_PS_OUTPUT=$(docker ps | grep $SERVER_NAME)
RUNNING_CONTAINER_NAME=$(echo "$DOCKER_PS_OUTPUT" | awk '{print $NF}')
Expand All @@ -13,15 +13,6 @@ IS_GREEN_ACTIVATE=$(docker ps | grep green-batch)

WEB_HEALTH_CHECK_URL=/api/health

# Redis Docker Image Pull
if [ -z "$IS_REDIS_ACTIVATE" ];then
echo "###### REDIS ######"
echo "[$NOW_TIME] Redis ๋„์ปค ์ด๋ฏธ์ง€ pull"
docker-compose pull redis
echo "[$NOW_TIME] Redis ์ปจํ…Œ์ด๋„ˆ Up (๋นŒ๋“œ & ์‹คํ–‰)"
docker-compose up -d redis
fi

# ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ ํ™•์ธ
if [ ${RUNNING_CONTAINER_NAME} == "blue-batch" ]; then
echo "[$NOW_TIME] ์‹คํ–‰ ์ค‘์ธ ์„œ๋ฒ„ ํฌํŠธ: blue-batch (:8081)"
Expand Down

0 comments on commit d178311

Please sign in to comment.