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
+27 -7
View File
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "" echo ""
echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}" echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}"
echo -e "${BOLD}${CYAN}║ d0a1 pack — Hermes Agent ║${NC}" echo -e "${BOLD}${CYAN}║ d0a1 pack — Hermes Agent ║${NC}"
echo -e "${BOLD}${CYAN}Tu agente de IA. Automatiza todo. ${NC}" echo -e "${BOLD}${CYAN}Agente de IA desde terminal o Telegram.${NC}"
echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}" echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}"
echo "" echo ""
@@ -54,30 +54,50 @@ if [ "$TOTAL_RAM_GB" -lt 3 ]; then
fi fi
echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB" echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB"
# ── Mode info ─────────────────────────────── # ── Auto-detect Ollama port ─────────────────
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
}
OLLAMA_PORT=$(find_free_port 11434)
if [ "$MODE" = "vps" ]; then if [ "$MODE" = "vps" ]; then
echo -e "${YELLOW}Modo:${NC} VPS" echo -e "${YELLOW}Modo:${NC} VPS"
echo "" echo ""
echo -e " ${BOLD}¿No tienes VPS?${NC} Consigue uno con descuento:" 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/vultr/${NC} — Vultr"
echo -e " ${CYAN}https://d0a1.es/go/digitalocean/ — DigitalOcean ($200 credit)" echo -e " ${CYAN}https://d0a1.es/go/digitalocean/${NC} — DigitalOcean (\$200 credit)"
echo "" echo ""
elif [ "$MODE" != "local" ]; then elif [ "$MODE" != "local" ]; then
echo -e "${RED}Modo desconocido: $MODE${NC}" echo -e "${RED}Modo desconocido: $MODE${NC}"
echo "Usa: ./deploy.sh local | vps | stop" echo "Usa: ./deploy.sh local | vps | stop"
exit 1 exit 1
fi fi
if [ "$OLLAMA_PORT" != "11434" ]; then
echo -e "${YELLOW}⚠ Puerto 11434 ocupado, usando ${OLLAMA_PORT}${NC}"
fi
echo "" echo ""
# ── 1. Arrancar Ollama (Docker) ────────────── # ── 1. Arrancar Ollama (Docker) ──────────────
echo -e "${YELLOW}[1/3]${NC} Arrancando Ollama (IA local)..." echo -e "${YELLOW}[1/3]${NC} Arrancando Ollama (IA local)..."
if ! docker ps --format '{{.Names}}' | grep -q d0a1-hermes-ollama; then if ! docker ps --format '{{.Names}}' | grep -q d0a1-hermes-ollama; then
docker run -d --name d0a1-hermes-ollama \ docker run -d --name d0a1-hermes-ollama \
-p 11434:11434 \ -p "${OLLAMA_PORT}:11434" \
-v d0a1_hermes_ollama:/root/.ollama \ -v d0a1_hermes_ollama:/root/.ollama \
-e OLLAMA_HOST=0.0.0.0 \ -e OLLAMA_HOST=0.0.0.0 \
--restart unless-stopped \ --restart unless-stopped \
ollama/ollama:0.32.6 ollama/ollama:0.33.0
fi fi
# Wait for Ollama # Wait for Ollama
@@ -94,7 +114,7 @@ until docker exec d0a1-hermes-ollama ollama ps &>/dev/null; do
done done
echo -e "${YELLOW} Descargando modelo (llama3.2:3b, ~2 GB)...${NC}" echo -e "${YELLOW} Descargando modelo (llama3.2:3b, ~2 GB)...${NC}"
docker exec d0a1-hermes-ollama ollama pull llama3.2:3b docker exec d0a1-hermes-ollama ollama pull llama3.2:3b
echo -e "${GREEN}${NC} Ollama corriendo en http://localhost:11434" echo -e "${GREEN}${NC} Ollama corriendo en http://localhost:${OLLAMA_PORT}"
# ── 2. Instalar Hermes Agent ──────────────── # ── 2. Instalar Hermes Agent ────────────────
echo -e "${YELLOW}[2/3]${NC} Instalando Hermes Agent..." echo -e "${YELLOW}[2/3]${NC} Instalando Hermes Agent..."
+27 -7
View File
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "" echo ""
echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}" echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}"
echo -e "${BOLD}${CYAN}║ d0a1 pack — OpenClaw ║${NC}" echo -e "${BOLD}${CYAN}║ d0a1 pack — OpenClaw ║${NC}"
echo -e "${BOLD}${CYAN}Tu asistente. En tus chats. ${NC}" echo -e "${BOLD}${CYAN}Asistente de IA en tus chats. ║${NC}"
echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}" echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}"
echo "" echo ""
@@ -54,30 +54,50 @@ if [ "$TOTAL_RAM_GB" -lt 3 ]; then
fi fi
echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB" echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB"
# ── Mode info ─────────────────────────────── # ── Auto-detect Ollama port ─────────────────
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
}
OLLAMA_PORT=$(find_free_port 11434)
if [ "$MODE" = "vps" ]; then if [ "$MODE" = "vps" ]; then
echo -e "${YELLOW}Modo:${NC} VPS" echo -e "${YELLOW}Modo:${NC} VPS"
echo "" echo ""
echo -e " ${BOLD}¿No tienes VPS?${NC} Consigue uno con descuento:" 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/vultr/${NC} — Vultr"
echo -e " ${CYAN}https://d0a1.es/go/digitalocean/ — DigitalOcean ($200 credit)" echo -e " ${CYAN}https://d0a1.es/go/digitalocean/${NC} — DigitalOcean (\$200 credit)"
echo "" echo ""
elif [ "$MODE" != "local" ]; then elif [ "$MODE" != "local" ]; then
echo -e "${RED}Modo desconocido: $MODE${NC}" echo -e "${RED}Modo desconocido: $MODE${NC}"
echo "Usa: ./deploy.sh local | vps | stop" echo "Usa: ./deploy.sh local | vps | stop"
exit 1 exit 1
fi fi
if [ "$OLLAMA_PORT" != "11434" ]; then
echo -e "${YELLOW}⚠ Puerto 11434 ocupado, usando ${OLLAMA_PORT}${NC}"
fi
echo "" echo ""
# ── 1. Arrancar Ollama (Docker) ────────────── # ── 1. Arrancar Ollama (Docker) ──────────────
echo -e "${YELLOW}[1/3]${NC} Arrancando Ollama (IA local)..." echo -e "${YELLOW}[1/3]${NC} Arrancando Ollama (IA local)..."
if ! docker ps --format '{{.Names}}' | grep -q d0a1-openclaw-ollama; then if ! docker ps --format '{{.Names}}' | grep -q d0a1-openclaw-ollama; then
docker run -d --name d0a1-openclaw-ollama \ docker run -d --name d0a1-openclaw-ollama \
-p 11434:11434 \ -p "${OLLAMA_PORT}:11434" \
-v d0a1_openclaw_ollama:/root/.ollama \ -v d0a1_openclaw_ollama:/root/.ollama \
-e OLLAMA_HOST=0.0.0.0 \ -e OLLAMA_HOST=0.0.0.0 \
--restart unless-stopped \ --restart unless-stopped \
ollama/ollama:0.32.6 ollama/ollama:0.33.0
fi fi
# Wait for Ollama # Wait for Ollama
@@ -94,7 +114,7 @@ until docker exec d0a1-openclaw-ollama ollama ps &>/dev/null; do
done done
echo -e "${YELLOW} Descargando modelo (llama3.2:3b, ~2 GB)...${NC}" echo -e "${YELLOW} Descargando modelo (llama3.2:3b, ~2 GB)...${NC}"
docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b docker exec d0a1-openclaw-ollama ollama pull llama3.2:3b
echo -e "${GREEN}${NC} Ollama corriendo en http://localhost:11434" echo -e "${GREEN}${NC} Ollama corriendo en http://localhost:${OLLAMA_PORT}"
# ── 2. Instalar OpenClaw ───────────────────── # ── 2. Instalar OpenClaw ─────────────────────
echo -e "${YELLOW}[2/3]${NC} Instalando OpenClaw..." echo -e "${YELLOW}[2/3]${NC} Instalando OpenClaw..."
+32 -7
View File
@@ -23,7 +23,7 @@ COMPOSE_FILE="$SCRIPT_DIR/docker-compose.yml"
echo "" echo ""
echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}" echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}"
echo -e "${BOLD}${CYAN}║ d0a1 pack — Open WebUI ║${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 -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}"
echo "" echo ""
@@ -57,22 +57,47 @@ if [ "$TOTAL_RAM_GB" -lt 3 ]; then
fi fi
echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB" 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 ─────────────────────────────── # ── Mode info ───────────────────────────────
if [ "$MODE" = "local" ]; then if [ "$MODE" = "local" ]; then
echo -e "${YELLOW}Modo:${NC} local (tu ordenador)" 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 elif [ "$MODE" = "vps" ]; then
echo -e "${YELLOW}Modo:${NC} VPS (accesible desde fuera)" 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 ""
echo -e " ${BOLD}¿No tienes VPS?${NC} Consigue uno con descuento:" 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/vultr/${NC} — Vultr"
echo -e " ${CYAN}https://d0a1.es/go/digitalocean/ — DigitalOcean ($200 credit)" echo -e " ${CYAN}https://d0a1.es/go/digitalocean/${NC} — DigitalOcean (\$200 credit)"
else else
echo -e "${RED}Modo desconocido: $MODE${NC}" echo -e "${RED}Modo desconocido: $MODE${NC}"
echo "Usa: ./deploy.sh local | vps | stop" echo "Usa: ./deploy.sh local | vps | stop"
exit 1 exit 1
fi 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 "" echo ""
# ── Deploy ────────────────────────────────── # ── Deploy ──────────────────────────────────
@@ -98,9 +123,9 @@ echo ""
echo -e "${BOLD}${GREEN}¡Listo! Tu IA está corriendo.${NC}" echo -e "${BOLD}${GREEN}¡Listo! Tu IA está corriendo.${NC}"
echo "" echo ""
if [ "$MODE" = "local" ]; then 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 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 fi
echo "" echo ""
echo -e " ${BOLD}Modelos alternativos:${NC}" echo -e " ${BOLD}Modelos alternativos:${NC}"
+5 -5
View File
@@ -1,5 +1,5 @@
# d0a1 pack — Open WebUI # d0a1 pack — Open WebUI
# Chat con IA en tu navegador. Como ChatGPT, pero privado. # Chat de IA privado. Sin cuenta, sin API key.
# #
# Local: ./deploy.sh local → http://localhost:3000 # Local: ./deploy.sh local → http://localhost:3000
# VPS: ./deploy.sh vps → http://TU_IP:3000 # VPS: ./deploy.sh vps → http://TU_IP:3000
@@ -10,10 +10,10 @@
services: services:
ollama: ollama:
container_name: d0a1-ollama container_name: d0a1-ollama
image: ollama/ollama:0.32.6 image: ollama/ollama:0.33.0
restart: unless-stopped restart: unless-stopped
ports: ports:
- "11434:11434" - "${OLLAMA_PORT:-11434}:11434"
volumes: volumes:
- ollama_data:/root/.ollama - ollama_data:/root/.ollama
environment: environment:
@@ -29,10 +29,10 @@ services:
openwebui: openwebui:
container_name: d0a1-openwebui container_name: d0a1-openwebui
image: ghcr.io/open-webui/open-webui:0.11.0 image: ghcr.io/open-webui/open-webui:0.11.1
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3000:8080" - "${WEBUI_PORT:-3000}:8080"
volumes: volumes:
- openwebui_data:/app/backend/data - openwebui_data:/app/backend/data
environment: environment:
+54 -19
View File
@@ -22,7 +22,7 @@ COMPOSE_FILE="$SCRIPT_DIR/docker-compose.yml"
echo "" echo ""
echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}" echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════╗${NC}"
echo -e "${BOLD}${CYAN}║ d0a1 pack — WordPress Agéntico${NC}" echo -e "${BOLD}${CYAN}║ d0a1 pack — WordPress + IA ${NC}"
echo -e "${BOLD}${CYAN}║ WP + IA local. Sin cuotas. ║${NC}" echo -e "${BOLD}${CYAN}║ WP + IA local. Sin cuotas. ║${NC}"
echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}" echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════╝${NC}"
echo "" echo ""
@@ -38,6 +38,7 @@ fi
# ── Check Docker ──────────────────────────── # ── Check Docker ────────────────────────────
if ! command -v docker &>/dev/null; then if ! command -v docker &>/dev/null; then
echo -e "${RED}✗ Docker no está instalado.${NC}" echo -e "${RED}✗ Docker no está instalado.${NC}"
echo ""
echo "Instálalo: curl -fsSL https://get.docker.com | sh" echo "Instálalo: curl -fsSL https://get.docker.com | sh"
exit 1 exit 1
fi fi
@@ -47,14 +48,6 @@ if ! docker compose version &>/dev/null; then
fi fi
echo -e "${GREEN}${NC} Docker: $(docker compose version --short 2>/dev/null || echo 'OK')" echo -e "${GREEN}${NC} Docker: $(docker compose version --short 2>/dev/null || echo 'OK')"
# ── Check .env for passwords ──────────────────────
if [ ! -f "$SCRIPT_DIR/.env" ]; then
echo -e "${YELLOW}⚠ No .env file found. Creating from .env.example..."
cp "$SCRIPT_DIR/.env.example" "$SCRIPT_DIR/.env"
echo -e "${YELLOW}⚠ Edit $SCRIPT_DIR/.env to set your own passwords before deploying to production."
echo -e "${CYAN} nano $SCRIPT_DIR/.env"${NC}
fi
# ── Check RAM ─────────────────────────────── # ── Check RAM ───────────────────────────────
TOTAL_RAM_KB=$(grep MemTotal /proc/meminfo 2>/dev/null | awk '{print $2}' || echo "0") TOTAL_RAM_KB=$(grep MemTotal /proc/meminfo 2>/dev/null | awk '{print $2}' || echo "0")
TOTAL_RAM_GB=$((TOTAL_RAM_KB / 1024 / 1024)) TOTAL_RAM_GB=$((TOTAL_RAM_KB / 1024 / 1024))
@@ -64,25 +57,67 @@ if [ "$TOTAL_RAM_GB" -lt 5 ]; then
fi fi
echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB" echo -e "${GREEN}${NC} RAM: ${TOTAL_RAM_GB} GB"
# ── Setup .env ──────────────────────────────
if [ ! -f "$SCRIPT_DIR/.env" ]; then
echo -e "${YELLOW}⚠ No se encontró .env. Creando desde .env.example...${NC}"
cp "$SCRIPT_DIR/.env.example" "$SCRIPT_DIR/.env"
# Generate random passwords for local dev
ROOT_PASS=$(openssl rand -hex 16 2>/dev/null || cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1)
WP_PASS=$(openssl rand -hex 16 2>/dev/null || cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1)
sed -i "s/change-me-to-a-strong-password/${ROOT_PASS}/g" "$SCRIPT_DIR/.env"
# Second occurrence is MYSQL_PASSWORD
sed -i "0,/change-me-to-a-strong-password/{s/change-me-to-a-strong-password/${WP_PASS}/}" "$SCRIPT_DIR/.env"
echo -e "${GREEN}${NC} Contraseñas generadas en ${SCRIPT_DIR}/.env"
fi
# ── 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 WP_PORT=$(find_free_port 8080)
export WEBUI_PORT=$(find_free_port 3000)
# ── Mode info ─────────────────────────────── # ── Mode info ───────────────────────────────
if [ "$MODE" = "local" ]; then if [ "$MODE" = "local" ]; then
echo -e "${YELLOW}Modo:${NC} local (tu ordenador)" echo -e "${YELLOW}Modo:${NC} local (tu ordenador)"
echo -e " WordPress: ${CYAN}http://localhost:8080${NC}" echo -e " WordPress: ${CYAN}http://localhost:${WP_PORT}${NC}"
echo -e " IA (chat): ${CYAN}http://localhost:3000${NC}" echo -e " IA (chat): ${CYAN}http://localhost:${WEBUI_PORT}${NC}"
elif [ "$MODE" = "vps" ]; then elif [ "$MODE" = "vps" ]; then
IP=$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'TU_IP') IP=$(hostname -I 2>/dev/null | awk '{print $1}' || echo 'TU_IP')
echo -e "${YELLOW}Modo:${NC} VPS (accesible desde fuera)" echo -e "${YELLOW}Modo:${NC} VPS (accesible desde fuera)"
echo -e " WordPress: ${CYAN}http://${IP}:8080${NC}" echo -e " WordPress: ${CYAN}http://${IP}:${WP_PORT}${NC}"
echo -e " IA (chat): ${CYAN}http://${IP}:3000${NC}" echo -e " IA (chat): ${CYAN}http://${IP}:${WEBUI_PORT}${NC}"
echo "" echo ""
echo -e " ${BOLD}¿No tienes VPS?${NC} Consigue uno con descuento:" 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/vultr/${NC} — Vultr"
echo -e " ${CYAN}https://d0a1.es/go/digitalocean/ — DigitalOcean ($200 credit)" echo -e " ${CYAN}https://d0a1.es/go/digitalocean/${NC} — DigitalOcean (\$200 credit)"
else else
echo -e "${RED}Modo desconocido: $MODE${NC}" echo -e "${RED}Modo desconocido: $MODE${NC}"
echo "Usa: ./deploy.sh local | vps | stop" echo "Usa: ./deploy.sh local | vps | stop"
exit 1 exit 1
fi fi
if [ "$OLLAMA_PORT" != "11434" ]; then
echo -e "${YELLOW}⚠ Puerto 11434 ocupado, usando ${OLLAMA_PORT}${NC}"
fi
if [ "$WP_PORT" != "8080" ]; then
echo -e "${YELLOW}⚠ Puerto 8080 ocupado, usando ${WP_PORT}${NC}"
fi
if [ "$WEBUI_PORT" != "3000" ]; then
echo -e "${YELLOW}⚠ Puerto 3000 ocupado, usando ${WEBUI_PORT}${NC}"
fi
echo "" echo ""
# ── Deploy ────────────────────────────────── # ── Deploy ──────────────────────────────────
@@ -108,11 +143,11 @@ echo ""
echo -e "${BOLD}${GREEN}¡Listo! Tu WordPress con IA está corriendo.${NC}" echo -e "${BOLD}${GREEN}¡Listo! Tu WordPress con IA está corriendo.${NC}"
echo "" echo ""
if [ "$MODE" = "local" ]; then if [ "$MODE" = "local" ]; then
echo -e " ${BOLD}WordPress:${NC} ${CYAN}http://localhost:8080${NC}" echo -e " ${BOLD}WordPress:${NC} ${CYAN}http://localhost:${WP_PORT}${NC}"
echo -e " ${BOLD}IA (chat):${NC} ${CYAN}http://localhost:3000${NC}" echo -e " ${BOLD}IA (chat):${NC} ${CYAN}http://localhost:${WEBUI_PORT}${NC}"
else else
echo -e " ${BOLD}WordPress:${NC} ${CYAN}http://${IP}:8080${NC}" echo -e " ${BOLD}WordPress:${NC} ${CYAN}http://${IP}:${WP_PORT}${NC}"
echo -e " ${BOLD}IA (chat):${NC} ${CYAN}http://${IP}:3000${NC}" echo -e " ${BOLD}IA (chat):${NC} ${CYAN}http://${IP}:${WEBUI_PORT}${NC}"
fi fi
echo "" echo ""
echo -e " ${BOLD}Configurar WordPress:${NC}" echo -e " ${BOLD}Configurar WordPress:${NC}"
+6 -6
View File
@@ -27,10 +27,10 @@ services:
wordpress: wordpress:
container_name: d0a1-wp container_name: d0a1-wp
image: wordpress:7.0-php8.4-apache image: wordpress:7.1-php8.4-apache
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8080:80" - "${WP_PORT:-8080}:80"
volumes: volumes:
- wp_data:/var/www/html - wp_data:/var/www/html
environment: environment:
@@ -44,10 +44,10 @@ services:
ollama: ollama:
container_name: d0a1-wp-ollama container_name: d0a1-wp-ollama
image: ollama/ollama:0.32.6 image: ollama/ollama:0.33.0
restart: unless-stopped restart: unless-stopped
ports: ports:
- "127.0.0.1:11434:11434" - "127.0.0.1:${OLLAMA_PORT:-11434}:11434"
volumes: volumes:
- ollama_data:/root/.ollama - ollama_data:/root/.ollama
environment: environment:
@@ -62,10 +62,10 @@ services:
openwebui: openwebui:
container_name: d0a1-wp-openwebui container_name: d0a1-wp-openwebui
image: ghcr.io/open-webui/open-webui:0.11.0 image: ghcr.io/open-webui/open-webui:0.11.1
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3000:8080" - "${WEBUI_PORT:-3000}:8080"
volumes: volumes:
- openwebui_data:/app/backend/data - openwebui_data:/app/backend/data
environment: environment: