PromucFlow_constructor/deploy/fat_container/templates/mongo-init.js.sh
geekup-legodevops 8119a74054
feat: Implement fat container for appsmith application (#6678)
Adds a Dockerfile along with accompanying scripts and definitions for building a fat Docker image. This image, when run as a container, will include the server, client, RTS, and necessary vendor services running all within.
2021-09-01 11:02:08 +05:30

34 lines
579 B
Bash

#!/bin/bash
set -o nounset
MONGO_ROOT_USER="$1"
MONGO_ROOT_PASSWORD="$2"
cat <<EOF
let error = false
print("**** Going to start Mongo seed ****")
var admin = db.getSiblingDB("admin")
admin.auth("$MONGO_ROOT_USER", "$MONGO_ROOT_PASSWORD")
let res = [
db.createUser(
{
user: "$MONGO_ROOT_USER",
pwd: "$MONGO_ROOT_PASSWORD",
roles: [{
role: "root",
db: "admin"
}, "readWrite"]
}
)
]
printjson(res)
if (error) {
print('Error occurred while inserting the records')
}
EOF