mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Add basic container healthcheck (#2625)
This commit is contained in:
parent
62fdcb05f5
commit
72650d4dc3
|
@ -26,3 +26,7 @@ services:
|
|||
stop_grace_period: 1m
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
healthcheck:
|
||||
test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
|
||||
timeout: 3s
|
||||
retries: 0
|
||||
|
|
|
@ -37,6 +37,7 @@ setup_file() {
|
|||
-e VIRUSMAILS_DELETE_DELAY=7 \
|
||||
-h mail.my-domain.com \
|
||||
--tty \
|
||||
--health-cmd "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1" \
|
||||
"${NAME}"
|
||||
|
||||
wait_for_finished_setup_in_container mail
|
||||
|
@ -1206,6 +1207,16 @@ EOF
|
|||
assert_failure
|
||||
}
|
||||
|
||||
#
|
||||
# healthcheck
|
||||
#
|
||||
|
||||
@test "checking container healthcheck" {
|
||||
run bash -c "docker inspect mail | jq -r '.[].State.Health.Status'"
|
||||
assert_output "healthy"
|
||||
assert_success
|
||||
}
|
||||
|
||||
#
|
||||
# supervisor
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue