feat: add timezone synchronization volume and update deployment scripts for health checks

Update the Docker README and create a Docker Deployment guide in the docs folder
This commit is contained in:
OhMyApps
2025-06-29 00:00:47 +02:00
parent 9291739672
commit fd2b14028a
6 changed files with 563 additions and 58 deletions

View File

@@ -158,7 +158,7 @@ try {
if (!$SkipHealthCheck) {
Write-ColorText "Waiting for service to be healthy..." -Color Green
# Simple timeout approach for health check
# Try simple timeout first, then use exponential backoff if needed
$timeout = $HealthCheckTimeout
$elapsed = 0
$healthy = $false
@@ -182,10 +182,13 @@ if (!$SkipHealthCheck) {
}
if (!$healthy) {
Write-ColorText "Service failed to become healthy within timeout" -Color Red
Write-ColorText "Checking logs:" -Color Yellow
docker-compose logs zen-mcp
exit 1
# Use exponential backoff retry mechanism
if (!(Wait-ForHealth)) {
Write-ColorText "Service failed to become healthy" -Color Red
Write-ColorText "Checking logs:" -Color Yellow
docker-compose logs zen-mcp
exit 1
}
}
}

View File

@@ -81,6 +81,7 @@ docker-compose up -d
# Wait for health check
echo -e "${GREEN}Waiting for service to be healthy...${NC}"
timeout 60 bash -c 'while [[ "$(docker-compose ps -q zen-mcp | xargs docker inspect -f "{{.State.Health.Status}}")" != "healthy" ]]; do sleep 2; done' || {
wait_for_health
echo -e "${RED}Service failed to become healthy${NC}"
echo -e "${YELLOW}Checking logs:${NC}"
docker-compose logs zen-mcp

View File

@@ -7,8 +7,6 @@ import os
import subprocess
import sys
import openai
def check_process():
"""Check if the main server process is running"""
@@ -78,33 +76,6 @@ def check_environment():
print(f"API key {key} appears too short or invalid", file=sys.stderr)
return False
# Optionally, try a minimal connectivity check for OpenAI and Google Gemini
# (only if their API keys are present)
try:
if os.getenv("OPENAI_API_KEY"):
openai.api_key = os.getenv("OPENAI_API_KEY")
try:
openai.Model.list()
except Exception as e:
print(f"OpenAI connectivity check failed: {e}", file=sys.stderr)
return False
except ImportError:
pass # Already checked in check_python_imports
try:
if os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY"):
import google.genai as genai
key = os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY")
genai.configure(api_key=key)
try:
genai.list_models()
except Exception as e:
print(f"Google Gemini connectivity check failed: {e}", file=sys.stderr)
return False
except ImportError:
pass # Already checked in check_python_imports
return True