diff --git a/Dockerfile b/Dockerfile index f587337..86e5677 100644 --- a/Dockerfile +++ b/Dockerfile @@ -121,9 +121,9 @@ RUN mkdir -p /home/web/data \ WORKDIR /home/web/data # Container defaults - Shopify AI App Builder -# Port 4000: Web UI (chat/builder interface) -# Port 4001: ttyd terminal -EXPOSE 4001 4000 +# Port 4500: Web UI (chat/builder interface) +# Port 4501: ttyd terminal +EXPOSE 4501 4500 HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=5 \ CMD /usr/local/bin/healthcheck.sh || exit 1 diff --git a/docker-compose.yml b/docker-compose.yml index 1371caa..7f4f8bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,8 @@ services: shopify-ai-builder: build: . ports: - - "4001:4001" - - "4000:4000" + - "4501:4501" + - "4500:4500" restart: unless-stopped environment: - OPENCODE_API_KEY=${OPENCODE_API_KEY:-} diff --git a/scripts/build-and-verify.ps1 b/scripts/build-and-verify.ps1 index 5416430..b37ba38 100644 --- a/scripts/build-and-verify.ps1 +++ b/scripts/build-and-verify.ps1 @@ -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." } diff --git a/scripts/diagnostic-logger.sh b/scripts/diagnostic-logger.sh index 91aabab..dd58fa0 100644 --- a/scripts/diagnostic-logger.sh +++ b/scripts/diagnostic-logger.sh @@ -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 diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index ddf67c7..9186e03 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -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 diff --git a/scripts/healthcheck.sh b/scripts/healthcheck.sh index b23a1ec..d7e07b3 100644 --- a/scripts/healthcheck.sh +++ b/scripts/healthcheck.sh @@ -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 diff --git a/stack-portainer.yml b/stack-portainer.yml index 30b1d0b..7ec4aeb 100644 --- a/stack-portainer.yml +++ b/stack-portainer.yml @@ -7,8 +7,8 @@ services: # Portainer automatically detects host architecture and passes TARGETARCH to Dockerfile # This enables reliable multi-architecture builds (amd64, arm64, etc.) ports: - - "4001:4001" - - "4000:4000" + - "4501:4501" + - "4500:4500" restart: unless-stopped environment: - OPENCODE_API_KEY=${OPENCODE_API_KEY:-}