From 2c88fbc493b451feb2091149a64184535c9d5028 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Thu, 14 Jan 2021 17:20:38 +0100 Subject: [PATCH] Added firefly health checks --- firefly/docker-compose.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/firefly/docker-compose.yml b/firefly/docker-compose.yml index 719e814..65e501e 100644 --- a/firefly/docker-compose.yml +++ b/firefly/docker-compose.yml @@ -1,18 +1,25 @@ -version: '3.3' +version: '2.8' services: app: build: context: '.' - dockerfile: './Dockerfile' args: - 'LOCALE=$DEFAULT_LOCALE' image: 'firefly-iii-cron:latest' restart: 'always' + healthcheck: + test: 'curl -f localhost:8080 || exit 1' + interval: '1m' + timeout: '10s' + retries: 3 + start_period: '10s' depends_on: - - 'db' - - 'redis' + db: + condition: 'service_healthy' + redis: + condition: 'service_healthy' env_file: - '.env' labels: @@ -26,6 +33,11 @@ services: db: image: 'postgres:13-alpine' restart: 'always' + healthcheck: + test: 'pg_isready -U $DB_USERNAME' + interval: '10s' + timeout: '5s' + retries: 5 environment: - 'POSTGRES_DB=$DB_DATABASE' @@ -39,11 +51,15 @@ services: redis: image: 'redis:6-alpine' restart: 'always' + healthcheck: + test: 'redis-cli -h localhost ping' + interval: '10s' + timeout: '5s' + retries: 3 labels: - 'com.centurylinklabs.watchtower.enable=true' - networks: nginx: external: true