Closed joubertredrat closed 1 year ago
@joubertredrat Thank you for the contribution. I must have missed the notification and I've just seen the PR. I don't have time to look into this for a real review, but I've set me a reminder to look into this. If you don't hear from me within a reasonable time frame, don't be shy to send a ping.
Checking whether something responds on port 8080, does not actually mean that Adminer is healthy: It does not guarantee that Adminer will be able to connect to the database.
However even for such a superficial health check, installing an extra executable is not required. The container necessarily contains PHP and that can be used to perform a health check, that is even more meaningful by actually checking whether the output looks reasonable:
php -r 'exit(strpos(file_get_contents("http://localhost:8080/"), "Adminer") !== false ? 0 : 1);'
This will exit with 0
(Success) if the HTTP response contains “Adminer” and with 1
(Failure) if it does not.
This PR adds netcat to have options to do health check on running container.
Example on terminal
Example on docker compose based from base into documentation on https://hub.docker.com/_/adminer/: