From 9becbef8c13e2c4f6d2aef9ce7ba06bf9ea162a8 Mon Sep 17 00:00:00 2001 From: PPawlowski Date: Fri, 15 Nov 2024 13:50:32 +0100 Subject: [PATCH] Add helathchecks to quickstart compose file --- docker-compose-quick-start.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docker-compose-quick-start.yml b/docker-compose-quick-start.yml index 39eb3f9..a120c26 100644 --- a/docker-compose-quick-start.yml +++ b/docker-compose-quick-start.yml @@ -96,6 +96,13 @@ services: target: /etc/nginx/conf.d/my_proxy.conf ports: - "80:80" + healthcheck: + test: "curl -s -I http://localhost | head -n 1 | grep -q 503" + interval: 5s + timeout: 5s + retries: 3 + start_period: 10s + postgres: image: postgres:14 networks: @@ -111,6 +118,13 @@ services: target: /docker-entrypoint-initdb.d/02-setup-context-db.sh volumes: - db:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 10s + timeout: 5s + retries: 3 + start_period: 10s + broker: image: "iegomez/mosquitto-go-auth" networks: @@ -125,6 +139,7 @@ services: configs: - source: flowfuse_broker target: /etc/mosquitto/mosquitto.conf + forge: image: "flowfuse/forge-docker" networks: @@ -143,6 +158,12 @@ services: - "postgres" - "nginx" - "broker" + healthcheck: + test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"] + interval: 5s + timeout: 5s + retries: 3 + start_period: 10s file-server: image: "flowfuse/file-server" @@ -156,6 +177,12 @@ services: - fileStorage:/usr/src/flowforge-file-server/var/root depends_on: - "forge" + healthcheck: + test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3001/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"] + interval: 5s + timeout: 5s + retries: 3 + start_period: 10s networks: flowforge: