TimWolla / docker-adminer

Database management in a single PHP file
https://hub.docker.com/_/adminer/
157 stars 69 forks source link

New 4.8.1 version breaks healthchecks #153

Closed lonix1 closed 11 months ago

lonix1 commented 11 months ago

This image was updated recently to 4.8.1 which was very exciting as it hadn't been updated in years (PS: thanks!)

But our containers started failing, and upon some investgation I realised it's because the new version is based on a base image that no longer supplies curl, wget or nc, etc. - so the healthchecks were failing.

Any of those commands can be used for healthchecks, and probably others too. But the base image has nothing useful. It seems to be a debian image, which is surprising, as even the busybox and alpine images at least have nc (and are significantly smaller).

lonix1 commented 11 months ago

I found this solution:

healthcheck:
  test: 'php -r "exit(strpos(file_get_contents(\"http://localhost:8080/\"), \"Adminer\") !== false ? 0 : 1);"'

I'd have never thought of that as I'm not a php dev. Thanks Tim!