fix(deploy): bring up infra services (redis) via separate up -d step

Previous deploy.sh only started services listed in BUILD_TARGETS, so the
newly-added redis service never came up after the SP-1 commit pushed to
NAS. Split image-based infra (redis) into INFRA_SERVICES and call
'docker compose up -d $INFRA_SERVICES' after the BUILD_TARGETS rebuild.

stop/rm is intentionally skipped for INFRA_SERVICES so AOF data
(/runtime/redis-data) survives each deploy cycle. Future infra services
(prometheus, grafana, ...) can join the same list.

Also add redis to HEALTH_ENDPOINTS so deployer's docker-inspect health
check waits for redis to report healthy before declaring DEPLOY_OK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-18 23:47:51 +09:00
parent 87651c9449
commit a9f38e1248

View File

@@ -18,8 +18,10 @@ flock -n 200 || { echo "Deploy already running, skipping"; exit 0; }
BUILD_TARGETS="lotto travel-proxy stock music-lab insta-lab realestate-lab agent-office personal packs-lab frontend"
# 컨테이너 이름 (고아 정리용 — blog-lab은 폐기 대상으로 정리 리스트에 유지)
CONTAINER_NAMES="lotto stock music-lab insta-lab blog-lab realestate-lab agent-office personal packs-lab travel-proxy frontend"
# Infra 서비스 (image-based, 영속 데이터 보존을 위해 stop/rm 없이 up만)
INFRA_SERVICES="redis"
# 헬스체크 대상
HEALTH_ENDPOINTS="lotto stock travel-proxy music-lab insta-lab realestate-lab agent-office personal packs-lab"
HEALTH_ENDPOINTS="lotto stock travel-proxy music-lab insta-lab realestate-lab agent-office personal packs-lab redis"
# data 디렉토리 (packs-lab은 별도 media/packs 사용)
DATA_DIRS="music stock insta realestate agent-office personal"
@@ -103,6 +105,9 @@ done
docker compose up -d --build $BUILD_TARGETS
docker exec frontend nginx -s reload 2>/dev/null || true
# 4) Infra 서비스 보장 (이미 떠 있으면 no-op, 없으면 시작 — 영속 데이터 보존)
docker compose up -d $INFRA_SERVICES
# ── 배포 후 헬스체크 ──
# Docker compose의 healthcheck 블록이 이미 모든 컨테이너에 정의되어 있으므로
# `docker inspect`로 컨테이너 health state를 직접 조회. 이 방식은