From f4d40bd1e7b58e7a1b87d343cf35b5c1e39ec7e9 Mon Sep 17 00:00:00 2001 From: Cyrille <1618640+cyri113@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:29:58 +0100 Subject: [PATCH] Update docker-compose.yml --- development/docker-compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/development/docker-compose.yml b/development/docker-compose.yml index eec9480..5f6099e 100644 --- a/development/docker-compose.yml +++ b/development/docker-compose.yml @@ -14,18 +14,21 @@ services: image: mongo:latest container_name: mongodb-dev restart: unless-stopped + command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017", "--keyFile", "/etc/mongo/replica.key"] ports: - 37017:27017 env_file: - ./.env.db volumes: + - /mongo/replica.key:/etc/mongo/replica.key - mongodb_data_container:/data/db - type: bind source: ../init-mongo.sh target: /docker-entrypoint-initdb.d/init-mongo.sh read_only: true healthcheck: - test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet + # test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet + test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb-dev'}]}) }" | mongosh --port 27017 --quiet interval: 60s timeout: 10s retries: 2