TrafeX / docker-php-nginx

Docker image with PHP-FPM 8.3 & Nginx 1.24 on Alpine Linux
https://hub.docker.com/r/trafex/php-nginx
MIT License
1.33k stars 721 forks source link

Add `|| exit 1` to `HEALTHCHECK` to map cURL exit codes and Docker possible values #167

Closed JoshuaLicense closed 4 months ago

JoshuaLicense commented 5 months ago

Description: This PR maps any returned cURL exit codes to possible values for the Docker HEALTHCHECK instruction.

Docker HEALTHCHECK instruction possible values:

The command's exit status indicates the health status of the container. The possible values are:

0: success - the container is healthy and ready for use 1: unhealthy - the container isn't working correctly 2: reserved - don't use this exit code

Source: https://docs.docker.com/engine/reference/builder/#healthcheck

cURL exit codes: https://everything.curl.dev/cmdline/exitcode

TrafeX commented 4 months ago

Hi @JoshuaLicense ,

Good catch! The current way does work (I've had unhealthy containers), but it's not correct. Merged! :tada: