From a3956dee254b8e5455410ee03b4dc1770189dc3d Mon Sep 17 00:00:00 2001 From: Artem Filin <221041513+ArtemFilin1990@users.noreply.github.com> Date: Tue, 20 Oct 2026 17:55:09 -0700 Subject: [PATCH] Use configured PORT for Docker healthcheck --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 144731b..c4a08f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,6 @@ ENV PYTHONUNBUFFERED=1 EXPOSE 8000 ENV PORT=8000 HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ - CMD python -c "from urllib.request import urlopen; urlopen('http://127.0.0.1:8000/health', timeout=3).close()" || exit 1 + CMD python -c "import os; from urllib.request import urlopen; urlopen('http://127.0.0.1:'+os.getenv('PORT','8000')+'/health', timeout=3).close()" || exit 1 CMD ["sh", "-c", "exec uvicorn main:app --app-dir src/api --host 0.0.0.0 --port ${PORT:-8000} --proxy-headers"]