Paste

Autor:

| Tamaño: 2.54 KB

|

<# .SYNOPSIS Start the Elysium stack safely. .PARAMETER LogLevel error, warn, log (default), debug, verbose .PARAMETER Build Rebuild images .PARAMETER Nuke Full reset: remove containers, volumes, wipe DBs, rebuild no-cache #>

param( [ValidateSet("error","warn","log","debug","verbose")] [string]$LogLevel = "log",

[switch]$Build,
[switch]$Nuke

)

$ErrorActionPreference = "Stop"

function Wait-For-Container { param($ContainerName)

Write-Host "    Waiting for $ContainerName to be healthy..."

do {
    Start-Sleep -Seconds 3
    $status = docker inspect --format='{{.State.Health.Status}}' $ContainerName 2>$null
} until ($status -eq "healthy")

Write-Host "    $ContainerName is healthy."

}

Write-Host "==> Starting Elysium stack..."

-------------------------------------------------

NUKE MODE

-------------------------------------------------

if ($Nuke) {

Write-Host "==> [NUKE] Removing containers + volumes..."
docker compose down -v --remove-orphans | Out-Null

if (Test-Path "data") {
    Write-Host "==> [NUKE] Removing data folder..."
    Remove-Item -Recurse -Force "data"
}

Write-Host "==> [NUKE] Rebuilding images (no cache)..."
docker compose build --no-cache

# ---- Neo4j ----
Write-Host "==> [NUKE] Starting neo4j..."
docker compose up -d neo4j
Wait-For-Container "elysium-neo4j"

Write-Host "    Wiping neo4j database..."
docker compose exec neo4j cypher-shell \`
    -u neo4j -p elysium\_secret \`
    "MATCH (n) DETACH DELETE n" | Out-Null

# ---- Postgres ----
Write-Host "==> [NUKE] Starting postgres..."
docker compose up -d postgres
Wait-For-Container "elysium-postgres"

Write-Host "    Truncating postgres tables..."
$sql = @"

DO \$\$ DECLARE r RECORD; BEGIN FOR r IN SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename <> 'prompts' LOOP EXECUTE 'TRUNCATE TABLE ' || quote_ident(r.tablename) || ' CASCADE'; END LOOP; END \$\$; "@

$sql | docker compose exec -T postgres psql -U elysium -d elysium | Out-Null

Write-Host "==> [NUKE] Database reset complete."

}

-------------------------------------------------

BUILD ONLY

-------------------------------------------------

elseif ($Build) { Write-Host "==> Building images..." docker compose build }

-------------------------------------------------

START ALL SERVICES

-------------------------------------------------

Write-Host "==> Starting all services..." docker compose up --force-recreate

Comentarios

Aún no hay comentarios

Por favor completa el captcha

2/17/2026

Crear nuevo paste con la misma configuración

No todo el contenido generado por usuarios es revisado por AnonPaste. Si crees que este paste viola nuestras pautas de la comunidad or términos de servicio, por favor repórtalo aquí.

Initializing...

Preparing the app. This may take a moment before app is ready.

AnonPaste es un servicio de alojamiento de contenido generado por usuarios. La plataforma y sus operadores no son responsables del contenido publicado por los usuarios.