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

@@ -41,7 +41,7 @@ EXPOSE 8001
# Health check (uses PORT env var with 8001 fallback)
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import os, httpx; port = os.getenv('PORT', '8001'); httpx.get(f'http://localhost:{port}/login', timeout=5)" || exit 1
CMD python -c "import os, httpx; port = os.getenv('PORT', '8001'); r = httpx.get(f'http://127.0.0.1:{port}/health', timeout=5); raise SystemExit(0 if r.status_code == 200 else 1)" || exit 1
# Run the application (uses PORT env var with 8001 fallback)
CMD sh -c "python -m uvicorn src.web.app:app --host 0.0.0.0 --port ${PORT:-8001}"