toptal / haste-server

open source pastebin written in node.js
https://www.toptal.com/developers/hastebin/about
2.92k stars 796 forks source link

healthcheck in docker file need a shell #401

Closed amm123 closed 2 years ago

amm123 commented 2 years ago

current health check will alway give unhealthy as it cannot access the ${PORT} without shell ( also it will no know what is the '||' without a shell) therefore it will always fail and docker will report unhealthy status it should use the shell command instead of the exec array.

CMD [ "curl" , "-f" "localhost:${PORT}", "||", "exit", "1"]

should be CMD curl -f localhost:${PORT} || exit 1

https://github.com/toptal/haste-server/commit/5a8d52a5e3e76e735cf135e33596f70cc548b138

konstrybakov commented 2 years ago

Hi @amm123, thanks for taking your time to open this issue, if you feel like this could be a beneficial addition to the project, you are welcome to open a PR with your suggestions!

konstrybakov commented 2 years ago

Hi @amm123 Healthcheck issue was resolved by https://github.com/toptal/haste-server/pull/389