Change ports from 4000/4001 to 4500/4501
This commit is contained in:
@@ -121,9 +121,9 @@ RUN mkdir -p /home/web/data \
|
|||||||
WORKDIR /home/web/data
|
WORKDIR /home/web/data
|
||||||
|
|
||||||
# Container defaults - Shopify AI App Builder
|
# Container defaults - Shopify AI App Builder
|
||||||
# Port 4000: Web UI (chat/builder interface)
|
# Port 4500: Web UI (chat/builder interface)
|
||||||
# Port 4001: ttyd terminal
|
# Port 4501: ttyd terminal
|
||||||
EXPOSE 4001 4000
|
EXPOSE 4501 4500
|
||||||
HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=5 \
|
HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=5 \
|
||||||
CMD /usr/local/bin/healthcheck.sh || exit 1
|
CMD /usr/local/bin/healthcheck.sh || exit 1
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ services:
|
|||||||
shopify-ai-builder:
|
shopify-ai-builder:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "4001:4001"
|
- "4501:4501"
|
||||||
- "4000:4000"
|
- "4500:4500"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- OPENCODE_API_KEY=${OPENCODE_API_KEY:-}
|
- OPENCODE_API_KEY=${OPENCODE_API_KEY:-}
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ if ($LASTEXITCODE -ne 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "All checks passed." -ForegroundColor Green
|
Write-Host "All checks passed." -ForegroundColor Green
|
||||||
Write-Host "Open http://localhost:4000 for the web interface." -ForegroundColor Cyan
|
Write-Host "Open http://localhost:4500 for the web interface." -ForegroundColor Cyan
|
||||||
Write-Host "Open http://localhost:4001 for the terminal." -ForegroundColor Cyan
|
Write-Host "Open http://localhost:4501 for the terminal." -ForegroundColor Cyan
|
||||||
Write-Host "Verifying `github` helper is available in profile (sourcing profile)..."
|
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"
|
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." }
|
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
|
fi
|
||||||
|
|
||||||
# Check if service responds to HTTP requests
|
# 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
|
if timeout 3 curl -s http://localhost:${port}/api/health > /dev/null 2>&1; then
|
||||||
diag_log "INFO" "HTTP endpoint responding"
|
diag_log "INFO" "HTTP endpoint responding"
|
||||||
else
|
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
|
# /opt/webchat_v2 is just a wrapper and causes module loading failures
|
||||||
CHAT_APP_DIR="${CHAT_APP_DIR:-/opt/webchat}"
|
CHAT_APP_DIR="${CHAT_APP_DIR:-/opt/webchat}"
|
||||||
CHAT_APP_FALLBACK="/opt/webchat_v2"
|
CHAT_APP_FALLBACK="/opt/webchat_v2"
|
||||||
CHAT_PORT="${CHAT_PORT:-4000}"
|
CHAT_PORT="${CHAT_PORT:-4500}"
|
||||||
CHAT_HOST="${CHAT_HOST:-0.0.0.0}"
|
CHAT_HOST="${CHAT_HOST:-0.0.0.0}"
|
||||||
ACCESS_PASSWORD="${ACCESS_PASSWORD:-}"
|
ACCESS_PASSWORD="${ACCESS_PASSWORD:-}"
|
||||||
|
|
||||||
@@ -376,6 +376,6 @@ fi
|
|||||||
|
|
||||||
# Start ttyd proxy instead of ttyd directly (on-demand activation)
|
# Start ttyd proxy instead of ttyd directly (on-demand activation)
|
||||||
log "Starting ttyd proxy (on-demand mode)"
|
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"
|
log "Idle timeout: 5 minutes of inactivity"
|
||||||
exec node /usr/local/bin/ttyd-proxy.js
|
exec node /usr/local/bin/ttyd-proxy.js
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Enhanced health check script for Shopify AI App Builder container
|
# 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
|
# Provides detailed diagnostics for debugging
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -158,33 +158,33 @@ main() {
|
|||||||
# Check system resources
|
# Check system resources
|
||||||
check_resources
|
check_resources
|
||||||
|
|
||||||
# Check chat service (port 4000)
|
# Check chat service (port 4500)
|
||||||
health_log "INFO" "=== Chat Service (port 4000) ==="
|
health_log "INFO" "=== Chat Service (port 4500) ==="
|
||||||
if ! check_port 4000 "chat service"; then
|
if ! check_port 4500 "chat service"; then
|
||||||
exit_code=1
|
exit_code=1
|
||||||
fi
|
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
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! check_process "chat service" 4000; then
|
if ! check_process "chat service" 4500; then
|
||||||
exit_code=1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check ttyd service (port 4001) - proxy running, ttyd starts on-demand
|
# Check ttyd service (port 4501) - proxy running, ttyd starts on-demand
|
||||||
health_log "INFO" "=== TTYD Proxy Service (port 4001) ==="
|
health_log "INFO" "=== TTYD Proxy Service (port 4501) ==="
|
||||||
if ! check_port 4001 "ttyd-proxy"; then
|
if ! check_port 4501 "ttyd-proxy"; then
|
||||||
exit_code=1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if proxy responds ( ttyd may not be running yet - that's OK )
|
# 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
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check proxy process (not ttyd - ttyd starts on-demand)
|
# 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
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ services:
|
|||||||
# Portainer automatically detects host architecture and passes TARGETARCH to Dockerfile
|
# Portainer automatically detects host architecture and passes TARGETARCH to Dockerfile
|
||||||
# This enables reliable multi-architecture builds (amd64, arm64, etc.)
|
# This enables reliable multi-architecture builds (amd64, arm64, etc.)
|
||||||
ports:
|
ports:
|
||||||
- "4001:4001"
|
- "4501:4501"
|
||||||
- "4000:4000"
|
- "4500:4500"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- OPENCODE_API_KEY=${OPENCODE_API_KEY:-}
|
- OPENCODE_API_KEY=${OPENCODE_API_KEY:-}
|
||||||
|
|||||||
Reference in New Issue
Block a user