From 5dbd7b00afab9e15b367400635d0f1c14fda4ef1 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 31 Oct 2024 16:40:39 +0800 Subject: [PATCH] fix: improve mongo service deploy in docker. --- docker-compose.yml | 2 +- scripts/mongo-init.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6d88bac10e..610ab9089b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: ports: - "37017:27017" container_name: mongo - command: ["/bin/bash", "-c", "/docker-entrypoint-initdb.d/mongo-init.sh; docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth"] + command: ["/bin/bash", "-c", "docker-entrypoint.sh mongod --wiredTigerCacheSizeGB 1 --auth & /docker-entrypoint-initdb.d/mongo-init.sh; wait"] volumes: - "${DATA_DIR}/components/mongodb/data/db:/data/db" - "${DATA_DIR}/components/mongodb/data/logs:/data/logs" diff --git a/scripts/mongo-init.sh b/scripts/mongo-init.sh index 25bb2d654c..968bc0840b 100755 --- a/scripts/mongo-init.sh +++ b/scripts/mongo-init.sh @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +echo "before running mongosh..." + mongosh <