# Script SEGURO para rebuild - NUNCA usa -v # Este script: # 1. Faz backup automatico # 2. Para os containers (SEM apagar volumes) # 3. Reconstroi as imagens # 4. Sobe tudo de novo Write-Host "=======================================" -ForegroundColor Cyan Write-Host " REBUILD SEGURO - Sem perda de dados" -ForegroundColor Cyan Write-Host "=======================================" -ForegroundColor Cyan Write-Host "" # 1. Backup automatico Write-Host "Passo 1/4: Fazendo backup..." -ForegroundColor Yellow & "g:\Projetos\aggios-app\scripts\backup-db.ps1" if ($LASTEXITCODE -ne 0) { Write-Host "Erro no backup! Abortando." -ForegroundColor Red exit 1 } Write-Host "" Write-Host "Passo 2/4: Parando containers..." -ForegroundColor Yellow docker-compose down # NAO USA -v para manter os volumes! Write-Host "" Write-Host "Passo 3/4: Reconstruindo imagens..." -ForegroundColor Yellow docker-compose build Write-Host "" Write-Host "Passo 4/4: Subindo containers..." -ForegroundColor Yellow docker-compose up -d Write-Host "" Write-Host "Rebuild concluido com seguranca!" -ForegroundColor Green Write-Host "Status dos containers:" -ForegroundColor Cyan docker-compose ps