Skip to content

Commit c775293

Browse files
authored
4.2 배포 테스트 (#135)
2 parents e4a0528 + c47093f commit c775293

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,12 @@ jib {
128128
jvmFlags = ['-Xms512m']
129129
format = 'OCI'
130130
creationTime = 'USE_CURRENT_TIMESTAMP'
131+
entrypoint = [
132+
'sh',
133+
'-c',
134+
'apk --no-cache add tzdata && \
135+
cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \
136+
java -cp /app/resources:/app/classes:/app/libs/* umc.codeplay.CodeplayApplication'
137+
]
131138
}
132139
}

docker/deploy/deploy.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ docker image prune -f
2323
echo "멈춘 container 삭제"
2424
docker container prune -f
2525

26-
for i in {1..10}; do
26+
for i in $(seq 1 10); do
2727
if [ "$i" -eq 10 ]; then
28-
echo "Health check failed"
29-
docker compose down
30-
exit 1
28+
echo "Health check failed after maximum attempts"
29+
docker compose down
30+
exit 1
3131
fi
3232

33-
if curl "http://localhost:8080/health"; then
33+
if curl -s "http://localhost:8080/health" > /dev/null; then
3434
echo "컨테이너가 정상적으로 실행되었습니다..."
3535
break
3636
fi
3737

38-
echo "spring boot application health check 중..."
38+
echo "spring boot application health check 중... (attempt $i/10)"
3939
sleep 15
4040
done
4141

docker/deploy/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ services:
2929
- umc_code_play
3030
restart: always
3131
depends_on:
32-
- database
32+
database:
33+
condition: service_healthy
3334

3435
networks:
3536
umc_code_play:

0 commit comments

Comments
 (0)