File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ This POSIX compliant sh script gets php-fpm status page using `cgi-fcgi` tool, p
77- [ Motivation] ( #motivation )
88- [ Installation] ( #installation )
99- [ Usage] ( #usage )
10+ - [ Docker example] ( #docker-example )
1011- [ Kubernetes example] ( #kubernetes-example )
1112- [ Why POSIX sh?] ( #why-posix-sh )
1213- [ Author and License] ( #author )
@@ -155,6 +156,18 @@ $ echo $?
1551560
156157```
157158
159+ ## Docker example
160+
161+ You can use ` HEALTHCHECK ` command on ` Dockerfile ` to define the health of your
162+ container. According to (Docker Docs)[ https://docs.docker.com/engine/reference/builder/#healthcheck ] ,
163+ possible return values are ` 0 ` for success, ` 1 ` to unhealthy and ` 2 ` is reserved
164+ and we ** must not** use this exit code.
165+
166+ ``` Dockerfile
167+ HEALTHCHECK --interval=5s --timeout=1s \
168+ CMD php-fpm-healthcheck || exit 1
169+ ```
170+
158171## Kubernetes example
159172
160173More and more people are looking for health checks on kubernetes for php-fpm, here is an example of livenessProbe and readinessProbe:
@@ -191,6 +204,9 @@ More and more people are looking for health checks on kubernetes for php-fpm, he
191204 periodSeconds : 5
192205` ` `
193206
207+ Docker ` HEALTHCHECK` command is ignored on Kubernetes and you must define it
208+ using pod specifications.
209+
194210# # Why POSIX sh
195211
196212Most of the containers contain limited software installed, using POSIX sh aims to be compatible with most of the OS images around.
You can’t perform that action at this time.
0 commit comments