Compare commits
4 Commits
feat/insta
...
088bbaa097
| Author | SHA1 | Date | |
|---|---|---|---|
| 088bbaa097 | |||
| be322557ee | |||
| 70438caa1f | |||
| e16029ebdb |
@@ -1,15 +1,23 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim-bookworm
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Korean fonts + Chromium runtime deps (Debian 12 / bookworm)
|
||||||
|
# `playwright install --with-deps`를 쓰지 않는 이유: 그 명령은 Ubuntu 패키지명을
|
||||||
|
# 사용해 Debian에서 ttf-ubuntu-font-family / ttf-unifont 등 없는 패키지를 시도
|
||||||
|
# → apt 실패. 대신 Chromium이 실제 필요로 하는 라이브러리만 명시 설치.
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
fonts-noto-cjk fonts-noto-cjk-extra \
|
fonts-noto-cjk fonts-noto-cjk-extra \
|
||||||
|
libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 \
|
||||||
|
libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \
|
||||||
|
libxfixes3 libxrandr2 libgbm1 libxshmfence1 libpango-1.0-0 \
|
||||||
|
libcairo2 libasound2 libatspi2.0-0 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
RUN playwright install --with-deps chromium
|
RUN playwright install chromium
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# ── 서비스 목록 (한 곳에서만 관리) ──
|
# ── 서비스 목록 (한 곳에서만 관리) ──
|
||||||
SERVICES="lotto travel-proxy deployer stock music-lab blog-lab realestate-lab agent-office personal packs-lab nginx scripts"
|
SERVICES="lotto travel-proxy deployer stock music-lab insta-lab realestate-lab agent-office personal packs-lab nginx scripts"
|
||||||
|
|
||||||
# 1. 자동 감지: Docker 컨테이너 내부인가?
|
# 1. 자동 감지: Docker 컨테이너 내부인가?
|
||||||
if [ -d "/repo" ] && [ -d "/runtime" ]; then
|
if [ -d "/repo" ] && [ -d "/runtime" ]; then
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ flock -n 200 || { echo "Deploy already running, skipping"; exit 0; }
|
|||||||
|
|
||||||
# ── 서비스 목록 (한 곳에서만 관리) ──
|
# ── 서비스 목록 (한 곳에서만 관리) ──
|
||||||
# docker compose 서비스명 (deployer 제외 — 자기 자신을 재빌드하면 스크립트 중단)
|
# docker compose 서비스명 (deployer 제외 — 자기 자신을 재빌드하면 스크립트 중단)
|
||||||
BUILD_TARGETS="lotto travel-proxy stock music-lab blog-lab realestate-lab agent-office personal packs-lab frontend"
|
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 blog-lab realestate-lab agent-office personal packs-lab travel-proxy frontend"
|
CONTAINER_NAMES="lotto stock music-lab insta-lab blog-lab realestate-lab agent-office personal packs-lab travel-proxy frontend"
|
||||||
# 헬스체크 대상
|
# 헬스체크 대상
|
||||||
HEALTH_ENDPOINTS="lotto stock travel-proxy music-lab blog-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"
|
||||||
# data 디렉토리 (packs-lab은 별도 media/packs 사용)
|
# data 디렉토리 (packs-lab은 별도 media/packs 사용)
|
||||||
DATA_DIRS="music stock blog realestate agent-office personal"
|
DATA_DIRS="music stock insta realestate agent-office personal"
|
||||||
|
|
||||||
# 1. 자동 감지: Docker 컨테이너 내부인가?
|
# 1. 자동 감지: Docker 컨테이너 내부인가?
|
||||||
if [ -d "/repo" ] && [ -d "/runtime" ]; then
|
if [ -d "/repo" ] && [ -d "/runtime" ]; then
|
||||||
@@ -96,13 +96,25 @@ docker compose up -d --build $BUILD_TARGETS
|
|||||||
docker exec frontend nginx -s reload 2>/dev/null || true
|
docker exec frontend nginx -s reload 2>/dev/null || true
|
||||||
|
|
||||||
# ── 배포 후 헬스체크 ──
|
# ── 배포 후 헬스체크 ──
|
||||||
echo "Waiting for services to start..."
|
# Docker compose의 healthcheck 블록이 이미 모든 컨테이너에 정의되어 있으므로
|
||||||
sleep 5
|
# `docker inspect`로 컨테이너 health state를 직접 조회. 이 방식은
|
||||||
|
# (a) deployer 컨테이너 내부에서도 호스트에서도 동일하게 동작
|
||||||
|
# (b) 호스트네임 DNS 해석에 의존하지 않음 (호스트 셸에서는 'lotto' 등 미해석)
|
||||||
|
echo "Waiting for services to become healthy..."
|
||||||
|
|
||||||
HEALTH_OK=true
|
HEALTH_OK=true
|
||||||
for svc in $HEALTH_ENDPOINTS; do
|
for svc in $HEALTH_ENDPOINTS; do
|
||||||
if ! curl -sf --max-time 10 --retry 2 --retry-delay 3 "http://$svc:8000/health" > /dev/null 2>&1; then
|
health="starting"
|
||||||
echo "HEALTH_FAIL: http://$svc:8000/health"
|
# 최대 60초 (5초×12) 동안 starting → healthy 전이 대기
|
||||||
|
for _ in $(seq 1 12); do
|
||||||
|
health=$(docker inspect --format='{{.State.Health.Status}}' "$svc" 2>/dev/null || echo "missing")
|
||||||
|
if [ "$health" = "healthy" ] || [ "$health" = "unhealthy" ] || [ "$health" = "missing" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
if [ "$health" != "healthy" ]; then
|
||||||
|
echo "HEALTH_FAIL: $svc (state=$health)"
|
||||||
HEALTH_OK=false
|
HEALTH_OK=false
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -44,8 +44,9 @@ check_url "Music Health" "http://localhost:18600/health"
|
|||||||
check_url "Music Providers" "http://localhost:18600/api/music/providers"
|
check_url "Music Providers" "http://localhost:18600/api/music/providers"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- 4. Blog Lab ---"
|
echo "--- 4. Insta Lab ---"
|
||||||
check_url "Blog Health" "http://localhost:18700/health"
|
check_url "Insta Health" "http://localhost:18700/health"
|
||||||
|
check_url "Insta Status" "http://localhost:18700/api/insta/status"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "--- 5. Realestate Lab ---"
|
echo "--- 5. Realestate Lab ---"
|
||||||
|
|||||||
Reference in New Issue
Block a user