From fe7aace9d76da954406835030e26324541cdc02b Mon Sep 17 00:00:00 2001 From: mirsal Date: Thu, 15 Jul 2021 16:09:15 +0000 Subject: [PATCH 1/2] compose: Add healthchecks to the peertube app service definition This commit adds a native healthcheck to the peertube app service using the nodejs command line interface. kudos to @3wordchant for the idea :) --- compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compose.yml b/compose.yml index affc103..00115ea 100644 --- a/compose.yml +++ b/compose.yml @@ -59,6 +59,12 @@ services: target: /docker-entrypoint.sh mode: 0555 command: npm start + healthcheck: + test: 'nodejs -e "http.get(''http://localhost:9000/api/v1/ping'', (res) => { console.log(''status: '', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });"' + interval: 1m + timeout: 30s + retries: 3 + start_period: 1m entrypoint: /docker-entrypoint.sh networks: - internal -- 2.40.1 From 95aa921e4e85eefe3861474ad753164bfb63dfb3 Mon Sep 17 00:00:00 2001 From: mirsal Date: Thu, 15 Jul 2021 16:32:36 +0000 Subject: [PATCH 2/2] compose: Enable rolling updates and rollbacks on the peertube app service --- compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compose.yml b/compose.yml index 00115ea..542843a 100644 --- a/compose.yml +++ b/compose.yml @@ -83,6 +83,9 @@ services: networks: - internal deploy: + update_config: + failure_action: rollback + order: start-first labels: ['coop-cloud.${STACK_NAME}.db.version=10-alpine-131220fe'] cache: image: redis:4-alpine -- 2.40.1