From 14fe307436b1fdb6e26c9c3fd8db5ca5bf24d432 Mon Sep 17 00:00:00 2001 From: Elisabeth Kulzer Date: Fri, 2 Oct 2020 12:32:23 +0200 Subject: [PATCH] Add healthcheck to docker-compose databases to easier debug (#15735) * Waiting for postgres to startup before tests * Add healthcheck * Test postgres default * Prefer pgisready command Co-authored-by: Agniva De Sarker Co-authored-by: Mattermod --- build/docker-compose.common.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/docker-compose.common.yml b/build/docker-compose.common.yml index 712161ef41..167c38b31c 100644 --- a/build/docker-compose.common.yml +++ b/build/docker-compose.common.yml @@ -11,6 +11,11 @@ services: MYSQL_PASSWORD: mostest MYSQL_USER: mmuser MYSQL_DATABASE: mattermost_test + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] + interval: 5s + timeout: 10s + retries: 3 postgres: image: "postgres:9.4" restart: always @@ -23,6 +28,11 @@ services: command: postgres -c 'config_file=/etc/postgresql/postgresql.conf' volumes: - "./docker/postgres.conf:/etc/postgresql/postgresql.conf" + healthcheck: + test: [ "CMD", "pg_isready", "-h", "localhost" ] + interval: 5s + timeout: 10s + retries: 3 minio: image: "minio/minio:RELEASE.2019-10-11T00-38-09Z" command: "server /data"