This is to show how healthcheck works in Docker Swarm.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

13 řádky
495 B

  1. #!/bin/sh
  2. # Mount /usr/share/nginx/html must be persistent for this test to work properly
  3. # in the Docker Swarm since it does not just restart the container but rather
  4. # removes it and then starts it.
  5. SFILE=/usr/share/nginx/html/status
  6. # I am unhealthy until I get restarted and then I will become healthy again.
  7. # That way I will be healthy every even run and unhealthy every odd run.
  8. grep dead $SFILE && ( echo alive | tee $SFILE ) || ( echo dead | tee $SFILE )
  9. exec nginx -g "daemon off;"