fixed coolify health checks

This commit is contained in:
2026-04-21 12:22:49 +02:00
parent 6347b53863
commit 8f2455026d
8 changed files with 52 additions and 6 deletions

View File

@@ -11,17 +11,25 @@ services:
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
linkedin-scheduler:
build: .
container_name: linkedin-scheduler
restart: unless-stopped
command: sh -c "python -m src.services.scheduler_runner"
healthcheck:
test: ["CMD", "python", "-c", "import os, time; p=os.getenv('SCHEDULER_HEALTH_FILE','/tmp/scheduler_heartbeat'); raise SystemExit(0 if os.path.exists(p) and time.time() - os.path.getmtime(p) < 120 else 1)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
env_file: .env
environment:
- PYTHONPATH=/app
- SCHEDULER_ENABLED=true
- REDIS_URL=redis://redis:6379/0
- SCHEDULER_HEALTH_FILE=/tmp/scheduler_heartbeat
volumes:
- ./logs:/app/logs
depends_on:
@@ -47,7 +55,7 @@ services:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:8001/login', timeout=5)"]
test: ["CMD", "python", "-c", "import httpx; r = httpx.get('http://127.0.0.1:8001/health', timeout=5); raise SystemExit(0 if r.status_code == 200 else 1)"]
interval: 30s
timeout: 10s
retries: 3