# DBX 메인 페이지 — 로컬 실행 스크립트 # 사용법: .\run-local.ps1 [명령어] # # .\run-local.ps1 → 시작 (코드 변경 시 자동 재빌드) # .\run-local.ps1 stop → 중지 # .\run-local.ps1 logs → 로그 보기 # .\run-local.ps1 ps → 상태 확인 # .\run-local.ps1 restart → 재시작 $PROJECT = "dbx-main" $COMPOSE = "docker compose -p $PROJECT -f docker-compose.local.yml" switch ($args[0]) { "stop" { Write-Host "컨테이너 중지 중..." -ForegroundColor Yellow Invoke-Expression "$COMPOSE down" } "logs" { Invoke-Expression "$COMPOSE logs -f" } "ps" { Invoke-Expression "$COMPOSE ps" } "restart" { Write-Host "재시작 중..." -ForegroundColor Yellow Invoke-Expression "$COMPOSE restart" } default { # .env.local 없으면 안내 후 종료 if (-not (Test-Path ".env.local")) { Write-Host "" Write-Host "❌ .env.local 파일이 없습니다." -ForegroundColor Red Write-Host " .env.local.example 을 복사하여 값을 채워주세요:" -ForegroundColor Yellow Write-Host " copy .env.local.example .env.local" -ForegroundColor Cyan Write-Host "" exit 1 } Write-Host "" Write-Host "🚀 DBX 메인 페이지 로컬 시작..." -ForegroundColor Cyan Invoke-Expression "$COMPOSE up --build -d" if ($LASTEXITCODE -eq 0) { Write-Host "" Write-Host "✅ 실행 중 → http://localhost:8080" -ForegroundColor Green Write-Host "" Write-Host " 로그 보기 : .\run-local.ps1 logs" -ForegroundColor Gray Write-Host " 중지 : .\run-local.ps1 stop" -ForegroundColor Gray Write-Host "" } } }