Change ports from 4000/4001 to 4500/4501
This commit is contained in:
@@ -31,8 +31,8 @@ if ($LASTEXITCODE -ne 0) {
|
||||
}
|
||||
|
||||
Write-Host "All checks passed." -ForegroundColor Green
|
||||
Write-Host "Open http://localhost:4000 for the web interface." -ForegroundColor Cyan
|
||||
Write-Host "Open http://localhost:4001 for the terminal." -ForegroundColor Cyan
|
||||
Write-Host "Open http://localhost:4500 for the web interface." -ForegroundColor Cyan
|
||||
Write-Host "Open http://localhost:4501 for the terminal." -ForegroundColor Cyan
|
||||
Write-Host "Verifying `github` helper is available in profile (sourcing profile)..."
|
||||
docker compose exec wordpress-plugin-ai-builder pwsh -NoProfile -Command ". /root/.config/powershell/Microsoft.PowerShell_profile.ps1; Get-Command github"
|
||||
if ($LASTEXITCODE -ne 0) { Write-Warning "`github` helper not detected. Ensure you built the image with the new profile, or update the volume via README instructions." }
|
||||
|
||||
@@ -118,7 +118,7 @@ check_service_status() {
|
||||
fi
|
||||
|
||||
# Check if service responds to HTTP requests
|
||||
if [ "$port" = "4000" ]; then
|
||||
if [ "$port" = "4500" ]; then
|
||||
if timeout 3 curl -s http://localhost:${port}/api/health > /dev/null 2>&1; then
|
||||
diag_log "INFO" "HTTP endpoint responding"
|
||||
else
|
||||
|
||||
@@ -172,7 +172,7 @@ log "Starting Shopify AI App Builder service and ttyd..."
|
||||
# /opt/webchat_v2 is just a wrapper and causes module loading failures
|
||||
CHAT_APP_DIR="${CHAT_APP_DIR:-/opt/webchat}"
|
||||
CHAT_APP_FALLBACK="/opt/webchat_v2"
|
||||
CHAT_PORT="${CHAT_PORT:-4000}"
|
||||
CHAT_PORT="${CHAT_PORT:-4500}"
|
||||
CHAT_HOST="${CHAT_HOST:-0.0.0.0}"
|
||||
ACCESS_PASSWORD="${ACCESS_PASSWORD:-}"
|
||||
|
||||
@@ -376,6 +376,6 @@ fi
|
||||
|
||||
# Start ttyd proxy instead of ttyd directly (on-demand activation)
|
||||
log "Starting ttyd proxy (on-demand mode)"
|
||||
log "ttyd will only run when port 4001 is accessed"
|
||||
log "ttyd will only run when port 4501 is accessed"
|
||||
log "Idle timeout: 5 minutes of inactivity"
|
||||
exec node /usr/local/bin/ttyd-proxy.js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Enhanced health check script for Shopify AI App Builder container
|
||||
# Checks both ttyd (port 4001) and chat service (port 4000)
|
||||
# Checks both ttyd (port 4501) and chat service (port 4500)
|
||||
# Provides detailed diagnostics for debugging
|
||||
|
||||
set -e
|
||||
@@ -158,33 +158,33 @@ main() {
|
||||
# Check system resources
|
||||
check_resources
|
||||
|
||||
# Check chat service (port 4000)
|
||||
health_log "INFO" "=== Chat Service (port 4000) ==="
|
||||
if ! check_port 4000 "chat service"; then
|
||||
# Check chat service (port 4500)
|
||||
health_log "INFO" "=== Chat Service (port 4500) ==="
|
||||
if ! check_port 4500 "chat service"; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
if ! check_http "http://localhost:4000/api/health" "chat service" 3; then
|
||||
if ! check_http "http://localhost:4500/api/health" "chat service" 3; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
if ! check_process "chat service" 4000; then
|
||||
if ! check_process "chat service" 4500; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
# Check ttyd service (port 4001) - proxy running, ttyd starts on-demand
|
||||
health_log "INFO" "=== TTYD Proxy Service (port 4001) ==="
|
||||
if ! check_port 4001 "ttyd-proxy"; then
|
||||
# Check ttyd service (port 4501) - proxy running, ttyd starts on-demand
|
||||
health_log "INFO" "=== TTYD Proxy Service (port 4501) ==="
|
||||
if ! check_port 4501 "ttyd-proxy"; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
# Check if proxy responds ( ttyd may not be running yet - that's OK )
|
||||
if ! check_http "http://localhost:4001/" "ttyd-proxy" 10; then
|
||||
if ! check_http "http://localhost:4501/" "ttyd-proxy" 10; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
# Check proxy process (not ttyd - ttyd starts on-demand)
|
||||
if ! check_process "ttyd-proxy" 4001; then
|
||||
if ! check_process "ttyd-proxy" 4501; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user