fix: MongoDB init
This commit is contained in:
@@ -49,6 +49,7 @@ services:
|
||||
mongo-init:
|
||||
<<: *default
|
||||
image: mongo:${MONGO_VERSION:-8.0.13}
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
mongo1:
|
||||
condition: service_healthy
|
||||
@@ -66,11 +67,13 @@ services:
|
||||
- -c
|
||||
- |
|
||||
set -e
|
||||
echo "Waiting for MongoDB node to be ready..."
|
||||
echo "Waiting for MongoDB nodes to be ready..."
|
||||
sleep 5
|
||||
|
||||
mongosh \
|
||||
--host "mongodb://$${MONGO_INITDB_ROOT_USERNAME}:$${MONGO_INITDB_ROOT_PASSWORD}@$${MONGO_HOST}:$${MONGO_PORT_1}" \
|
||||
--host "$${MONGO_HOST}:$${MONGO_PORT_1}" \
|
||||
--username "$${MONGO_INITDB_ROOT_USERNAME}" \
|
||||
--password "$${MONGO_INITDB_ROOT_PASSWORD}" \
|
||||
--authenticationDatabase admin \
|
||||
--eval "
|
||||
const config = {
|
||||
|
||||
@@ -58,6 +58,7 @@ services:
|
||||
mongo-init:
|
||||
<<: *default
|
||||
image: mongo:${MONGO_VERSION:-8.0.13}
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
mongo1:
|
||||
condition: service_healthy
|
||||
@@ -85,7 +86,9 @@ services:
|
||||
sleep 5
|
||||
|
||||
mongosh \
|
||||
--host "mongodb://$${MONGO_INITDB_ROOT_USERNAME}:$${MONGO_INITDB_ROOT_PASSWORD}@$${MONGO_HOST}:$${MONGO_PORT_1}" \
|
||||
--host "$${MONGO_HOST}:$${MONGO_PORT_1}" \
|
||||
--username "$${MONGO_INITDB_ROOT_USERNAME}" \
|
||||
--password "$${MONGO_INITDB_ROOT_PASSWORD}" \
|
||||
--authenticationDatabase admin \
|
||||
--eval "
|
||||
const config = {
|
||||
|
||||
Reference in New Issue
Block a user