File size: 1,628 Bytes
6aa6081
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Talos Access — Quickstart
# ===========================
# Corre todo el stack: Docker + seed + frontend en el navegador

Write-Host "=== Talos Access: Levantando servicios ===" -ForegroundColor Cyan

# 1. Asegurar que Docker Desktop esté corriendo
$dockerOk = $false
try { docker ps | Out-Null; $dockerOk = $true } catch {}
if (-not $dockerOk) {
    Write-Host "Iniciando Docker Desktop..." -ForegroundColor Yellow
    Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe"
    $i = 0
    while ($i -lt 30) {
        try { docker ps 2>$null | Out-Null; if ($?) { break } } catch {}
        Start-Sleep -Seconds 2
        $i++
    }
}

# 2. Matar cualquier node que esté ocupando el puerto 5173 (ej: Laravel)
$existing = netstat -ano | Select-String ":5173.*LISTENING"
if ($existing) {
    $pid = ($existing -split '\s+')[-1]
    $proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
    if ($proc -and $proc.ProcessName -eq 'node') {
        Write-Host "Matando node local en puerto 5173 ($pid)..." -ForegroundColor Yellow
        Stop-Process -Id $pid -Force
    }
}

# 3. Buildear y arrancar contenedores
docker compose up -d --build

# 4. Correr migraciones + seed
docker compose exec -T backend alembic upgrade head
docker compose exec -T backend python seed.py

# 5. Abrir navegador
Start-Process "http://localhost:5173"

Write-Host "`n=== Talos Access listo ===" -ForegroundColor Green
Write-Host "Frontend : http://localhost:5173" -ForegroundColor Cyan
Write-Host "API Docs : http://localhost:8000/docs" -ForegroundColor Cyan
Write-Host "Login    : admin@talos.com / admin123" -ForegroundColor Cyan