feat: pull del modelo respeta HTTPS_PROXY

Tu red no llega al registry de Ollama (R2/Cloudflare). Si hay proxy
definido en HTTPS_PROXY, se pasa al contenedor en el pull (doc oficial
de Ollama para Docker). Sin proxy, el mensaje de error explica como
definirlo y relanzar.
This commit is contained in:
hermes committed 2026-09-12 20:58:42 +02:00
1 parent 912105f16f
commit 9ac790f8f3
4 files changed
+40 -8

No files matched your search

+10 -2
View File
@@ -175,17 +175,25 @@ while ($true) {
exit 1
}
}
# Si el usuario define $env:HTTPS_PROXY, Ollama lo usa para el pull (doc oficial):
$ProxyEnv = @()
if ($env:HTTPS_PROXY) { $ProxyEnv = @('-e', "HTTPS_PROXY=$env:HTTPS_PROXY", '-e', "HTTP_PROXY=$env:HTTP_PROXY") }
$PullOk = $false
foreach ($Attempt in 1..3) {
if ($Attempt -gt 1) { Warn "Reintento $Attempt de 3..." }
docker exec d0a1-wp-ollama ollama pull llama3.2:3b
docker exec @ProxyEnv d0a1-wp-ollama ollama pull llama3.2:3b
if ($LASTEXITCODE -eq 0) { $PullOk = $true; break }
Warn 'Descarga interrumpida (red). Reintentando en 5 s...'
Start-Sleep -Seconds 5
}
if (-not $PullOk) {
Err 'Fallo la descarga del modelo tras 3 intentos.'
Write-Host ' Revisa tu red (VPN/proxy) y reintenta a mano:'
if (-not $env:HTTPS_PROXY) {
Write-Host ' Tu red no llega al registry de Ollama. Si tienes proxy/VPN, lanzalo y:'
Write-Host ' $env:HTTPS_PROXY = "http://127.0.0.1:7890" # (ajusta al puerto de tu proxy)'
Write-Host ' .\deploy.ps1 vps'
}
Write-Host ' O reintenta a mano:'
Write-Host ' docker exec d0a1-wp-ollama ollama pull llama3.2:3b'
exit 1
}