fixed coolify health checks
This commit is contained in:
@@ -27,6 +27,7 @@ services:
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
|
||||
linkedin-scheduler:
|
||||
build: .
|
||||
@@ -34,10 +35,17 @@ services:
|
||||
command: python -m src.services.scheduler_runner
|
||||
labels:
|
||||
- traefik.enable=false
|
||||
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
|
||||
environment:
|
||||
- PYTHONPATH=/app
|
||||
- SCHEDULER_ENABLED=true
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
- SCHEDULER_HEALTH_FILE=/tmp/scheduler_heartbeat
|
||||
volumes:
|
||||
- logs:/app/logs
|
||||
depends_on:
|
||||
@@ -61,7 +69,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
|
||||
|
||||
Reference in New Issue
Block a user