This commit is contained in:
@@ -35,6 +35,19 @@ services:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- mongodb_supplychain_data:/data/db
|
||||
- ./init/mongo:/docker-entrypoint-initdb.d:ro
|
||||
|
||||
mongo-express:
|
||||
image: mongo-express
|
||||
container_name: mongo_express
|
||||
depends_on:
|
||||
- mongodb-supplychain
|
||||
ports:
|
||||
- "8081:8081"
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_URL: mongodb://mo:Dell2026%21@mongodb_supplychain:27017/?authSource=admin
|
||||
ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
|
||||
ME_CONFIG_BASICAUTH: "false"
|
||||
|
||||
cassandra-telemetry:
|
||||
image: cassandra:4.1
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Idempotent admin users for lab (mo + bart)
|
||||
db = db.getSiblingDB("admin");
|
||||
var pw = "Dell2026!";
|
||||
["mo", "bart"].forEach(function(name) {
|
||||
if (db.getUser(name) == null) {
|
||||
db.createUser({
|
||||
user: name,
|
||||
pwd: pw,
|
||||
roles: [{ role: "root", db: "admin" }]
|
||||
});
|
||||
print("Created user: " + name);
|
||||
} else {
|
||||
print("User exists: " + name);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user