Merge pull request #7 from southseact-3d/cto-task-ok-so-for-this-can-you-remove-the-stuff-from-port-4501-and-u
Remove port 4501 and update health check to not require ttyd service
This commit is contained in:
@@ -105,7 +105,6 @@ RUN chmod 644 /root/.config/powershell/Microsoft.PowerShell_profile.ps1
|
||||
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
COPY scripts/healthcheck.sh /usr/local/bin/healthcheck.sh
|
||||
COPY scripts/diagnostic-logger.sh /usr/local/bin/diagnostic-logger.sh
|
||||
COPY scripts/ttyd-proxy.js /usr/local/bin/ttyd-proxy.js
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/healthcheck.sh /usr/local/bin/diagnostic-logger.sh
|
||||
|
||||
# Chat web service assets
|
||||
@@ -122,8 +121,7 @@ WORKDIR /home/web/data
|
||||
|
||||
# Container defaults - Shopify AI App Builder
|
||||
# Port 4500: Web UI (chat/builder interface)
|
||||
# Port 4501: ttyd terminal
|
||||
EXPOSE 4501 4500
|
||||
EXPOSE 4500
|
||||
HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=5 \
|
||||
CMD /usr/local/bin/healthcheck.sh || exit 1
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ services:
|
||||
shopify-ai-builder:
|
||||
build: .
|
||||
ports:
|
||||
- "4501:4501"
|
||||
- "4500:4500"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
@@ -32,7 +32,6 @@ if ($LASTEXITCODE -ne 0) {
|
||||
|
||||
Write-Host "All checks passed." -ForegroundColor Green
|
||||
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." }
|
||||
|
||||
@@ -166,7 +166,7 @@ else
|
||||
mkdir -p "$REPO_DIR"
|
||||
fi
|
||||
|
||||
log "Starting Shopify AI App Builder service and ttyd..."
|
||||
log "Starting Shopify AI App Builder service..."
|
||||
|
||||
# Use /opt/webchat directly as it contains the actual server.js with node_modules
|
||||
# /opt/webchat_v2 is just a wrapper and causes module loading failures
|
||||
@@ -374,8 +374,6 @@ if [ -n "$CHAT_PID" ]; then
|
||||
log "Health monitor started with PID: $MONITOR_PID"
|
||||
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 4501 is accessed"
|
||||
log "Idle timeout: 5 minutes of inactivity"
|
||||
exec node /usr/local/bin/ttyd-proxy.js
|
||||
# Keep the container running
|
||||
log "Container started successfully. Waiting for chat service..."
|
||||
wait "$CHAT_PID" || true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Enhanced health check script for Shopify AI App Builder container
|
||||
# Checks both ttyd (port 4501) and chat service (port 4500)
|
||||
# Checks chat service (port 4500)
|
||||
# Provides detailed diagnostics for debugging
|
||||
|
||||
set -e
|
||||
@@ -172,24 +172,7 @@ main() {
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
# 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:4501/" "ttyd-proxy" 10; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
# Check proxy process (not ttyd - ttyd starts on-demand)
|
||||
if ! check_process "ttyd-proxy" 4501; then
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
# Optionally log that ttyd starts on-demand
|
||||
health_log "INFO" "ttyd-proxy active (ttyd starts on-demand when visited)"
|
||||
# ttyd service has been removed, no longer checking port 4501
|
||||
|
||||
health_log "INFO" "========== HEALTH CHECK END ==========="
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ services:
|
||||
# Portainer automatically detects host architecture and passes TARGETARCH to Dockerfile
|
||||
# This enables reliable multi-architecture builds (amd64, arm64, etc.)
|
||||
ports:
|
||||
- "4501:4501"
|
||||
- "4500:4500"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user