From 00c089e6771eb6dc8118f670af0ee44799016238 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 18 Aug 2025 14:22:31 +0500 Subject: [PATCH] docker: get rid of `initiate-rs0` --- docker-compose.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4b49251..d607c8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,30 +59,11 @@ services: validate: condition: service_completed_successfully healthcheck: - test: echo 'db.runCommand("ping").ok' | mongosh mongodb://localhost:27017 --quiet + test: echo 'try { rs.status() } catch (err) { rs.initiate() }' | echo 'db.runCommand("ping").ok' | mongosh mongodb://localhost:27017 --quiet interval: 40s timeout: 30s retries: 3 start_period: 60s - # the notesnook sync server requires transactions which only work - # with a MongoDB replica set. - # This job just runs `rs.initiate()` on our mongodb instance - # upgrading it to a replica set. This is only required once but we running - # it multiple times is no issue. - initiate-rs0: - image: mongo:7.0.12 - networks: - - notesnook - depends_on: - - notesnook-db - entrypoint: /bin/sh - command: - - -c - - | - mongosh mongodb://notesnook-db:27017 <