From 6b54e0da6df611a970e3fc89232da7486bcd4c35 Mon Sep 17 00:00:00 2001 From: Apple Date: Tue, 3 Feb 2026 05:56:02 -0800 Subject: [PATCH] fix(router): Replace requests with urllib in healthcheck - Use stdlib urllib.request instead of requests library - requests was not installed in the router image, causing healthcheck to always fail with "ModuleNotFoundError: No module named 'requests'" - Increase start_period to 30s and retries to 5 for stability Co-authored-by: Cursor --- services/router/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/router/Dockerfile b/services/router/Dockerfile index 445f002f..529a115d 100644 --- a/services/router/Dockerfile +++ b/services/router/Dockerfile @@ -12,9 +12,9 @@ COPY . . # Expose port EXPOSE 8000 -# Health check -HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD python -c "import requests; requests.get('http://localhost:8000/health')" +# Health check (using urllib - no external deps) +HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=5 \ + CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" # Run application CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]