Sign inSign up

goodservers/docker-doctor

By goodservers

•Updated over 6 years ago

Health checker container for achieving zero downtime when using one container for app.

Image
1

10K+

goodservers/docker-doctor repository overview

⁠Docker doctor - health checker container for achieving zero downtime when using one container for app

CircleCI

The docker container checker waits until the new container is fully prepared and then removes the old one. Basically it checks the docker event sent from staring container. If have set HEALTH_CHECKER environment property then waits until their health is ok and afterwards old container is stopped and removed.

⁠Example

You have some application defined in docker (see examples/nodejsapp). When your CI runs the deployment phase it starts the new container and removes old one. But it takes some time to boot up application to healthy state. And if you have only one container it causes downtime. So you can setup the checker which waits until the new container is fully prepared and then removes the old one.

⁠Setup on server

docker-compose up

or see the example of usage with nginx, nginx-proxy, letsencrypt as a server docker-gateway⁠

⁠Setup for example app examples/nodejsapp

docker-compose -f docker-compose.yml --project-name=$(date +%s) up --scale nodejs_app=1 -d

⁠Environment props

envvaluesdefaultmeaning
VIRTUAL_PORTnumber-application listening port (same name as for nginx-proxy)
HEALTH_CHECKERhttp, https-active script used to check health
HEALTH_MAX_RETRYnumber30(optional) maximum number of attempts to check health
HEALTH_TIMEOUTnumber1000(optional) number of ms to check in one attempt

⁠Requirements

Tag summary

Content type

Image

Digest

Size

20 MB

Last updated

over 6 years ago

docker pull goodservers/docker-doctor