From 73a42b5fd1fbf135e354f51a9f63b55858d7ea96 Mon Sep 17 00:00:00 2001 From: Damian Fajfer Date: Tue, 30 Apr 2024 22:09:14 +0200 Subject: [PATCH] Add mongoinit to fix initial docker-compose file --- docker-compose.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d8384ee0e1..7dbc8bc247 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '2.2' services: sharelatex: restart: always @@ -108,6 +107,7 @@ services: restart: always image: mongo:5.0 container_name: mongo + command: "--replSet overleaf" expose: - 27017 volumes: @@ -118,6 +118,20 @@ services: timeout: 10s retries: 5 + mongoinit: + image: mongo:5.0 + # this container will exit after executing the command + restart: no + depends_on: + mongo: + condition: service_healthy + command: + - mongo + - --host + - mongo:27017 + - --eval + - 'rs.initiate({ _id: "overleaf", members: [ { _id: 0, host: "mongo:27017" } ] })' + redis: restart: always image: redis:6.2