mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: add mongo init script, use root in app image
This commit is contained in:
1 parent
ec90c484b4
commit
c3030b22be
5 files changed
+28
-13
No files matched your search
@@ -0,0 +1,10 @@
|
||||
const user = process.env.MONGO_USER
|
||||
const password = process.env.MONGO_PASS
|
||||
const dbName = process.env.MONGO_DB
|
||||
|
||||
db = db.getSiblingDB(dbName)
|
||||
db.createUser({
|
||||
user: user,
|
||||
pwd: password,
|
||||
roles: [{ role: 'readWrite', db: dbName }],
|
||||
})
|
||||
Reference in new issue
Block a user