forked from baron/baron-sso
gateway 분리 적용
This commit is contained in:
31
gateway/entrypoint.sh
Normal file
31
gateway/entrypoint.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 대상 호스트와 포트가 준비될 때까지 대기하는 함수
|
||||
wait_for_host() {
|
||||
host=$1
|
||||
port=$2
|
||||
name=$3
|
||||
|
||||
echo "Waiting for $name ($host:$port)..."
|
||||
|
||||
# 최대 30초 동안 대기
|
||||
count=0
|
||||
until nc -z $host $port || [ $count -eq 30 ]; do
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
done
|
||||
|
||||
if [ $count -eq 30 ]; then
|
||||
echo "Timeout waiting for $name"
|
||||
else
|
||||
echo "$name is ready!"
|
||||
fi
|
||||
}
|
||||
|
||||
# 백엔드와 유저프론트 대기 (Oathkeeper는 인프라 레벨이므로 함께 뜰 가능성이 높지만 안전을 위해 포함)
|
||||
wait_for_host "baron_backend" 3000 "Backend"
|
||||
wait_for_host "baron_userfront" 5000 "UserFront"
|
||||
wait_for_host "oathkeeper" 4455 "Oathkeeper"
|
||||
|
||||
echo "All dependencies are up. Starting Nginx..."
|
||||
exec nginx -g 'daemon off;'
|
||||
Reference in New Issue
Block a user