From 78ac4eda7217d3ec420dea675e25a7d96c5ca884 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Fri, 5 Apr 2024 16:27:07 -0300 Subject: [PATCH] docker-compose.yml fixed mongo rs init command --- docker-compose.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d13470c..dd5abbe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,13 +3,15 @@ version: "3.9" services: mongo-1: image: "mongo:${MONGO_VERSION}" - environment: - MONGO_INITDB_REPLICA_SET_NAME: ${MONGO_REPLICA_SET} command: --replSet ${MONGO_REPLICA_SET} --port ${MONGO_1_PORT} ports: - "${MONGO_1_PORT}:${MONGO_1_PORT}" volumes: - ./storage/mongo-1/:/data/db + healthcheck: + test: echo "try { rs.status() } catch (err) { rs.initiate() }" | mongosh --port ${MONGO_1_PORT} --quiet + interval: 10s + start_period: 30s redis: image: "redis/redis-stack-server:${REDIS_VERSION}"