deployer: Docker CLI 설치 방식 개선 + 헬스체크 수정

- Dockerfile: docker.io → docker-ce-cli + docker-compose-plugin (Docker 공식 저장소)
  - python:3.12-slim에서 docker.io가 제대로 동작하지 않던 문제 해결
  - root 유저로 실행하여 Docker 소켓 접근 보장
- deploy.sh: 헬스체크 URL을 서비스명:내부포트로 변경
  - 컨테이너 내부에서 localhost:18000 접근 불가 문제 해결

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 14:03:58 +09:00
parent d2606d7317
commit 4b339d9d4f
2 changed files with 13 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ ls -dt "$DST/.releases"/*/ 2>/dev/null | tail -n +6 | xargs -r rm -rf
# ── 소스 → 운영 반영 ──
bash "$SRC/scripts/deploy-nas.sh"
# ── 컨테이너 재빌드 (deployer 제외 — 자기 자신을 재빌드하면 스크립트 중단됨) ──
# ── 변경된 서비스만 재빌드 (deployer 제외 — 자기 자신을 재빌드하면 스크립트 중단됨) ──
cd "$DST"
docker compose up -d --build backend travel-proxy stock-lab music-lab frontend
docker exec lotto-frontend nginx -s reload 2>/dev/null || true
@@ -60,7 +60,8 @@ echo "Waiting for services to start..."
sleep 5
HEALTH_OK=true
for endpoint in "http://localhost:18000/health" "http://localhost:18500/health" "http://localhost:19000/health" "http://localhost:18600/health"; do
# 컨테이너 내부에서는 서비스명 + 내부포트(8000)로 접근
for endpoint in "http://backend:8000/health" "http://stock-lab:8000/health" "http://travel-proxy:8000/health" "http://music-lab:8000/health"; do
if ! curl -sf --max-time 10 --retry 2 --retry-delay 3 "$endpoint" > /dev/null 2>&1; then
echo "HEALTH_FAIL: $endpoint"
HEALTH_OK=false