From 23fd53576e23c36e8715a94e7e6c3c9abb3ebcd9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:57:01 +0000 Subject: [PATCH] Fix healthcheck to respect PORT environment variable Co-authored-by: ThePhaseless <33990351+ThePhaseless@users.noreply.github.com> --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4c25e9b..52438f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ ENV GITHUB_BUILD=${GITHUB_BUILD}\ # prevents python creating .pyc files PYTHONDONTWRITEBYTECODE=1 \ UV_LINK_MODE=copy \ - UV_CACHE_DIR=${UV_CACHE_DIR} + UV_CACHE_DIR=${UV_CACHE_DIR} \ + PORT=8191 RUN apt update &&\ apt -y upgrade &&\ @@ -52,6 +53,7 @@ RUN \ uv run pytest --retries 3 FROM app -EXPOSE 8191 -HEALTHCHECK --interval=15m --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "http://localhost:8191/health" ] +EXPOSE $PORT +# Shell form is required here (instead of exec form) to enable ${PORT} variable expansion at runtime +HEALTHCHECK --interval=15m --timeout=30s --start-period=5s --retries=3 CMD curl "http://localhost:${PORT}/health" ENTRYPOINT ["uv", "run", "main.py"]