From bff8cf75e5463ff1db36b866843e2951dab164c5 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 11 Sep 2019 14:07:26 +0200 Subject: [PATCH] Added mongo healthcheck to docker-compose (#636) --- server-ce/docker-compose.debug.yml | 2 +- server-ce/docker-compose.yml | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/server-ce/docker-compose.debug.yml b/server-ce/docker-compose.debug.yml index 9bcc623047..f6f5657c19 100644 --- a/server-ce/docker-compose.debug.yml +++ b/server-ce/docker-compose.debug.yml @@ -1,4 +1,4 @@ -version: '2' +version: '2.2' services: sharelatex: ports: diff --git a/server-ce/docker-compose.yml b/server-ce/docker-compose.yml index 623bdf29ea..725c241318 100644 --- a/server-ce/docker-compose.yml +++ b/server-ce/docker-compose.yml @@ -1,12 +1,14 @@ -version: '2' +version: '2.2' services: sharelatex: restart: always image: sharelatex/sharelatex container_name: sharelatex depends_on: - - mongo - - redis + mongo: + condition: service_healthy + redis: + condition: service_started privileged: true ports: - 80:80 @@ -93,6 +95,11 @@ services: - 27017 volumes: - ~/mongo_data:/data/db + healthcheck: + test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet + interval: 10s + timeout: 10s + retries: 5 redis: restart: always