Files

12 lines
394 B
Bash
Raw Permalink Normal View History

2026-04-28 13:39:45 +02:00
#!/bin/bash
# Creates the explorer app user in explorerdb.
# Runs once on first container start (only when the data volume is empty).
mongosh -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin <<EOF
use $MONGO_APP_DB
db.createUser({
user: "$MONGO_APP_USER",
pwd: "$MONGO_APP_PASS",
roles: [{ role: "readWrite", db: "$MONGO_APP_DB" }]
})
EOF