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/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
COPY scripts/healthcheck.sh /usr/local/bin/healthcheck.sh
|
COPY scripts/healthcheck.sh /usr/local/bin/healthcheck.sh
|
||||||
COPY scripts/diagnostic-logger.sh /usr/local/bin/diagnostic-logger.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
|
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/healthcheck.sh /usr/local/bin/diagnostic-logger.sh
|
||||||
|
|
||||||
# Chat web service assets
|
# Chat web service assets
|
||||||
@@ -122,8 +121,7 @@ WORKDIR /home/web/data
|
|||||||
|
|
||||||
# Container defaults - Shopify AI App Builder
|
# Container defaults - Shopify AI App Builder
|
||||||
# Port 4500: Web UI (chat/builder interface)
|
# Port 4500: Web UI (chat/builder interface)
|
||||||
# Port 4501: ttyd terminal
|
EXPOSE 4500
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
2478
chat/package-lock.json
generated
2478
chat/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@ services:
|
|||||||
shopify-ai-builder:
|
shopify-ai-builder:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "4501:4501"
|
|
||||||
- "4500:4500"
|
- "4500:4500"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ if ($LASTEXITCODE -ne 0) {
|
|||||||
|
|
||||||
Write-Host "All checks passed." -ForegroundColor Green
|
Write-Host "All checks passed." -ForegroundColor Green
|
||||||
Write-Host "Open http://localhost:4500 for the web interface." -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)..."
|
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." }
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ else
|
|||||||
mkdir -p "$REPO_DIR"
|
mkdir -p "$REPO_DIR"
|
||||||
fi
|
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
|
# 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
|
# /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"
|
log "Health monitor started with PID: $MONITOR_PID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start ttyd proxy instead of ttyd directly (on-demand activation)
|
# Keep the container running
|
||||||
log "Starting ttyd proxy (on-demand mode)"
|
log "Container started successfully. Waiting for chat service..."
|
||||||
log "ttyd will only run when port 4501 is accessed"
|
wait "$CHAT_PID" || true
|
||||||
log "Idle timeout: 5 minutes of inactivity"
|
|
||||||
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 4501) and chat service (port 4500)
|
# Checks chat service (port 4500)
|
||||||
# Provides detailed diagnostics for debugging
|
# Provides detailed diagnostics for debugging
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -172,24 +172,7 @@ main() {
|
|||||||
exit_code=1
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check ttyd service (port 4501) - proxy running, ttyd starts on-demand
|
# ttyd service has been removed, no longer checking port 4501
|
||||||
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)"
|
|
||||||
|
|
||||||
health_log "INFO" "========== HEALTH CHECK END ==========="
|
health_log "INFO" "========== HEALTH CHECK END ==========="
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ 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:
|
||||||
- "4501:4501"
|
|
||||||
- "4500:4500"
|
- "4500:4500"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user