Bump versions, add port auto-detection, require .env for WP

- Ollama: 0.32.6 → 0.33.0
- Open WebUI: 0.11.0 → 0.11.1
- WordPress: 7.0 → 7.1
- All compose: ports use env vars for auto-detection
- All deploy.sh: find_free_port() — increments port by 1 until free
- WordPress compose: MYSQL vars require .env (no insecure defaults)
- WordPress deploy.sh: auto-generates .env with random passwords
- WordPress deploy.sh: auto-detects ports for WP, Ollama, and WebUI
This commit is contained in:
devops
2026-08-27 00:38:32 +02:00
parent 2a1d629273
commit b7a8983b99
6 changed files with 152 additions and 52 deletions
+32 -7
View File
@@ -23,7 +23,7 @@ COMPOSE_FILE="$SCRIPT_DIR/docker-compose.yml"
echo ""
echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}"
echo -e "${BOLD}${CYAN}║ d0a1 pack — Open WebUI ║${NC}"
echo -e "${BOLD}${CYAN}║ Chat con IA. Privado. Sin cuotas. ${NC}"
echo -e "${BOLD}${CYAN}║ Chat de IA privado. Sin cuenta, sin API key.${NC}"
echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}"
echo ""
@@ -57,22 +57,47 @@ if [ "$TOTAL_RAM_GB" -lt 3 ]; then
fi
echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB"
# ── Auto-detect ports ───────────────────────
find_free_port() {
local port=$1
local max_port=$((port + 20))
while [ "$port" -le "$max_port" ]; do
if ! ss -tlnp 2>/dev/null | grep -q ":${port} " && ! netstat -tlnp 2>/dev/null | grep -q ":${port} "; then
echo "$port"
return 0
fi
port=$((port + 1))
done
echo "$1"
return 1
}
export OLLAMA_PORT=$(find_free_port 11434)
export WEBUI_PORT=$(find_free_port 3000)
# ── Mode info ───────────────────────────────
if [ "$MODE" = "local" ]; then
echo -e "${YELLOW}Modo:${NC} local (tu ordenador)"
echo -e " URL: ${CYAN}http://localhost:3000${NC}"
echo -e " URL: ${CYAN}http://localhost:${WEBUI_PORT}${NC}"
elif [ "$MODE" = "vps" ]; then
echo -e "${YELLOW}Modo:${NC} VPS (accesible desde fuera)"
echo -e " URL: ${CYAN}http://$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'TU_IP'):3000${NC}"
echo -e " URL: ${CYAN}http://$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'TU_IP'):${WEBUI_PORT}${NC}"
echo ""
echo -e " ${BOLD}¿No tienes VPS?${NC} Consigue uno con descuento:"
echo -e " ${CYAN}https://d0a1.es/go/vultr/ — Vultr"
echo -e " ${CYAN}https://d0a1.es/go/digitalocean/ — DigitalOcean ($200 credit)"
echo -e " ${CYAN}https://d0a1.es/go/vultr/${NC} — Vultr"
echo -e " ${CYAN}https://d0a1.es/go/digitalocean/${NC} — DigitalOcean (\$200 credit)"
else
echo -e "${RED}Modo desconocido: $MODE${NC}"
echo "Usa: ./deploy.sh local | vps | stop"
exit 1
fi
if [ "$OLLAMA_PORT" != "11434" ]; then
echo -e "${YELLOW}⚠ Puerto 11434 ocupado, usando ${OLLAMA_PORT}${NC}"
fi
if [ "$WEBUI_PORT" != "3000" ]; then
echo -e "${YELLOW}⚠ Puerto 3000 ocupado, usando ${WEBUI_PORT}${NC}"
fi
echo ""
# ── Deploy ──────────────────────────────────
@@ -98,9 +123,9 @@ echo ""
echo -e "${BOLD}${GREEN}¡Listo! Tu IA está corriendo.${NC}"
echo ""
if [ "$MODE" = "local" ]; then
echo -e " ${BOLD}Abre:${NC} ${CYAN}http://localhost:3000${NC}"
echo -e " ${BOLD}Abre:${NC} ${CYAN}http://localhost:${WEBUI_PORT}${NC}"
else
echo -e " ${BOLD}Abre:${NC} ${CYAN}http://$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'TU_IP'):3000${NC}"
echo -e " ${BOLD}Abre:${NC} ${CYAN}http://$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'TU_IP'):${WEBUI_PORT}${NC}"
fi
echo ""
echo -e " ${BOLD}Modelos alternativos:${NC}"