diff --git a/docs/index.html b/docs/index.html index 9db48fe1..b08ead72 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4604,9 +4604,9 @@ class: extra-details --- -name: healthchecks +name: healthcheck -class: healthchecks +class: healthcheck # Health checks @@ -4628,7 +4628,7 @@ class: healthchecks --- -class: healthchecks +class: healthcheck ## Defining health checks @@ -4732,7 +4732,7 @@ class: healthcheck - Go to the `stacks` directory: ```bash - cd ~/orchestration-workshop/ + cd ~/orchestration-workshop/stacks ``` - Deploy the updated stack: @@ -4761,10 +4761,10 @@ First, let's make an "innocent" change and deploy it. - Build, ship, and run the new image: ```bash - docker-compose -f dockercoins+healthchecks.yml build + export TAG=v0.3; docker-compose -f dockercoins+healthchecks.yml build docker-compose -f dockercoins+healthchecks.yml push docker service update dockercoins_hasher \ - --detach=false --image=127.0.0.1:5000/hasher:latest + --detach=false --image=127.0.0.1:5000/hasher:$TAG ``` ] @@ -4786,10 +4786,10 @@ And now, a breaking change that will cause the health check to fail: - Build, ship, and run the new image: ```bash - docker-compose -f dockercoins+healthchecks.yml build + export TAG=v0.4; docker-compose -f dockercoins+healthchecks.yml build docker-compose -f dockercoins+healthchecks.yml push docker service update dockercoins_hasher \ - --detach=false --image=127.0.0.1:5000/hasher:latest + --detach=false --image=127.0.0.1:5000/hasher:$TAG ``` ] diff --git a/stacks/dockercoins+healthcheck.yml b/stacks/dockercoins+healthcheck.yml new file mode 100644 index 00000000..79291c5c --- /dev/null +++ b/stacks/dockercoins+healthcheck.yml @@ -0,0 +1,36 @@ +version: "3" + +services: + rng: + build: dockercoins/rng + image: ${REGISTRY-127.0.0.1:5000}/rng:${TAG-latest} + deploy: + mode: global + + hasher: + build: dockercoins/hasher + image: ${REGISTRY-127.0.0.1:5000}/hasher:${TAG-latest} + deploy: + replicas: 7 + update_config: + delay: 5s + failure_action: rollback + max_failure_ratio: .5 + monitor: 5s + parallelism: 1 + + webui: + build: dockercoins/webui + image: ${REGISTRY-127.0.0.1:5000}/webui:${TAG-latest} + ports: + - "8000:80" + + redis: + image: redis + + worker: + build: dockercoins/worker + image: ${REGISTRY-127.0.0.1:5000}/worker:${TAG-latest} + deploy: + replicas: 10 +