Skip to content

Commit

Permalink
Use PHP-FPM status endpoint for health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusklocke committed Dec 14, 2023
1 parent 6043518 commit 704a623
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docker/php/docker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ clear_env = no
; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes
decorate_workers_output = no

; Enable status endpoint for health checks
pm.status_path = /_status
5 changes: 3 additions & 2 deletions docker/php/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/sh
# Inspired by: https://github.com/renatomefi/php-fpm-healthcheck/tree/master
set -eu

REQUEST_METHOD="GET" \
REQUEST_URI="/api/health" \
SCRIPT_FILENAME="public/index.php" \
SCRIPT_NAME="/_status" \
SCRIPT_FILENAME="/_status" \
cgi-fcgi -bind -connect 127.0.0.1:9000

# Line feed
Expand Down

0 comments on commit 704a623

Please sign in to comment.