From 793f91e7fb1fa265c2042ed120749122c7d9b810 Mon Sep 17 00:00:00 2001 From: Italo Date: Sat, 29 Jun 2024 23:42:26 -0400 Subject: [PATCH] Adds healthcheck for runner --- templates/compose/forgejo-with-runner-with-mariadb.yaml | 5 ++++- templates/compose/forgejo-with-runner-with-mysql.yaml | 5 ++++- templates/compose/forgejo-with-runner-with-postgresql.yaml | 5 ++++- templates/compose/forgejo-with-runner.yaml | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/templates/compose/forgejo-with-runner-with-mariadb.yaml b/templates/compose/forgejo-with-runner-with-mariadb.yaml index 805aa0d9f..b137c9382 100644 --- a/templates/compose/forgejo-with-runner-with-mariadb.yaml +++ b/templates/compose/forgejo-with-runner-with-mariadb.yaml @@ -125,7 +125,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done diff --git a/templates/compose/forgejo-with-runner-with-mysql.yaml b/templates/compose/forgejo-with-runner-with-mysql.yaml index 9487694af..21c62c06d 100644 --- a/templates/compose/forgejo-with-runner-with-mysql.yaml +++ b/templates/compose/forgejo-with-runner-with-mysql.yaml @@ -125,7 +125,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done diff --git a/templates/compose/forgejo-with-runner-with-postgresql.yaml b/templates/compose/forgejo-with-runner-with-postgresql.yaml index bac4a4681..486c7a462 100644 --- a/templates/compose/forgejo-with-runner-with-postgresql.yaml +++ b/templates/compose/forgejo-with-runner-with-postgresql.yaml @@ -124,7 +124,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done diff --git a/templates/compose/forgejo-with-runner.yaml b/templates/compose/forgejo-with-runner.yaml index 7865e8fa4..2e526cbde 100644 --- a/templates/compose/forgejo-with-runner.yaml +++ b/templates/compose/forgejo-with-runner.yaml @@ -102,7 +102,10 @@ services: - forgejo-localtime:/etc/localtime:ro restart: 'unless-stopped' healthcheck: - disable: true + test: ["CMD", "pgrep", "forgejo-runner"] + interval: 10s + timeout: 30s + retries: 10 command: >- bash -c ' while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done