Skip to content

Conversation

haiyuewa
Copy link
Contributor

When "docker run -e LLAMA_ARG_PORT=8088", the container health status is always '(unhealthy)', since the command is fixed as "http://localhost:8080/health".

Use the enviroment value 'LLAMA_ARG_PORT' to start health checking to avoid this problem.

Make sure to read the contributing guidelines before submitting a PR

When "docker run -e LLAMA_ARG_PORT=8088", the container health status is always
'(unhealthy)', since the command is fixed as "http://localhost:8080/health".

Use the enviroment value 'LLAMA_ARG_PORT' to start health checking to avoid this
problem.
@haiyuewa haiyuewa requested a review from ngxson as a code owner September 12, 2025 05:58
@github-actions github-actions bot added the devops improvements to build systems and github actions label Sep 12, 2025
@taronaeo
Copy link
Collaborator

Why would you use the LLAMA_ARG_PORT environment variable to change the port instead of using the Docker flag -p e.g., -p 80:8080?

@xuanson2025
Copy link

Same question as @taronaeo

Most dockerfiles that I know have quite simple HEALTHCHECK with fixed port, so I think we should also keep our version simple.

@@ -0,0 +1,3 @@
#!/bin/sh

curl -f "http://localhost:${LLAMA_ARG_PORT:-8080}/health"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exit code doesn't seem to be forwarded. This will cause the script to always report success result even when it isn't

@haiyuewa
Copy link
Contributor Author

with fixed port,

Thanks, yes, "-p 80:8080" is a good practice. Make sense to keep thing simple @xuanson2025 👍

@haiyuewa haiyuewa closed this Sep 13, 2025
@haiyuewa haiyuewa deleted the fix-container-unhealthy-status branch September 13, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants