From 2a635be9fc770fcba965f030dee4810315522629 Mon Sep 17 00:00:00 2001 From: Behzad Rabiei <53224485+Behzad-rabiei@users.noreply.github.com> Date: Mon, 29 Jan 2024 00:10:19 +0330 Subject: [PATCH] [CI]: working on the CI --- docker-compose.test.yml | 6 ++++-- mongo-init.js | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 mongo-init.js diff --git a/docker-compose.test.yml b/docker-compose.test.yml index b41e6ba4..55789f5b 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -10,8 +10,8 @@ services: - NODE_ENV=test - DB_HOST=mongo - DB_PORT=27017 - - DB_USER=root - - DB_PASSWORD=pass + - DB_USER=user + - DB_PASSWORD=1234 - DB_NAME=RnDAO - DISCORD_CLIENT_ID=1 - DISCORD_CLIENT_SECRET=1 @@ -41,6 +41,8 @@ services: - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=pass - MONGO_INITDB_DATABASE=RnDAO + volumes: + - ./docker-entrypoint-initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro healthcheck: test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet interval: 60s diff --git a/mongo-init.js b/mongo-init.js new file mode 100644 index 00000000..920ed657 --- /dev/null +++ b/mongo-init.js @@ -0,0 +1,4 @@ +print("Started Adding the Users."); +db = db.getSiblingDB("RnDAO"); +db.createUser({ user: "user", pwd: "1234", roles: ["readWrite"] }) +print("End Adding the User Roles."); \ No newline at end of file