Skip to content

Commit

Permalink
Merge pull request #43 from wandersonwhcr/feature/docker-exit
Browse files Browse the repository at this point in the history
Docker Exit
  • Loading branch information
wandersonwhcr committed Jan 12, 2022
2 parents 7c35191 + 2ed6e79 commit 06cc809
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This POSIX compliant sh script gets php-fpm status page using `cgi-fcgi` tool, p
- [Motivation](#motivation)
- [Installation](#installation)
- [Usage](#usage)
- [Docker example](#docker-example)
- [Kubernetes example](#kubernetes-example)
- [Why POSIX sh?](#why-posix-sh)
- [Author and License](#author)
Expand Down Expand Up @@ -155,6 +156,18 @@ $ echo $?
0
```

## Docker example

You can use `HEALTHCHECK` command on `Dockerfile` to define the health of your
container. According to (Docker Docs)[https://docs.docker.com/engine/reference/builder/#healthcheck],
possible return values are `0` for success, `1` to unhealthy and `2` is reserved
and we **must not** use this exit code.

```Dockerfile
HEALTHCHECK --interval=5s --timeout=1s \
CMD php-fpm-healthcheck || exit 1
```

## Kubernetes example

More and more people are looking for health checks on kubernetes for php-fpm, here is an example of livenessProbe and readinessProbe:
Expand Down Expand Up @@ -191,6 +204,9 @@ More and more people are looking for health checks on kubernetes for php-fpm, he
periodSeconds: 5
```
Docker `HEALTHCHECK` command is ignored on Kubernetes and you must define it
using pod specifications.

## Why POSIX sh

Most of the containers contain limited software installed, using POSIX sh aims to be compatible with most of the OS images around.
Expand Down

0 comments on commit 06cc809

Please sign in to comment.