Add Dockerfile HEALTHCHECK command and basic healthcheck reply (#918)

This commit is contained in:
Gilad Peleg
2025-09-15 18:41:41 +03:00
committed by GitHub
parent 2727f7b061
commit 20d6f8dbee
2 changed files with 11 additions and 0 deletions

View File

@@ -47,5 +47,9 @@ ARG SOFTWARE_VERSION=1.20.0
ENTRYPOINT ["dumb-init", "--"]
# Requires docker engine 25+ for the --start-interval flag
HEALTHCHECK --interval=2m --timeout=2s --start-period=20s --start-interval=5s --retries=3 \
CMD ["curl", "-fsS", "127.0.0.1/health.php"]
# Start both PHP-FPM, Nginx
CMD ["/var/www/html/startup.sh"]

7
health.php Normal file
View File

@@ -0,0 +1,7 @@
<?php
header('Content-Type: text/plain');
http_response_code(200);
echo 'OK';
exit;