feat: add MongoDB and Mongo Express services with initialization script
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m41s
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m41s
This commit is contained in:
33
server/mongodb/initdb.d/mongo-init.js
Normal file
33
server/mongodb/initdb.d/mongo-init.js
Normal file
@@ -0,0 +1,33 @@
|
||||
db = db.getSiblingDB("statistics");
|
||||
|
||||
db.createRole({
|
||||
role: "statsReadWrite",
|
||||
privileges: [
|
||||
{
|
||||
resource: {
|
||||
db: "statistics",
|
||||
collection: "peertube",
|
||||
},
|
||||
actions: ["insert"],
|
||||
},
|
||||
],
|
||||
roles: [
|
||||
{
|
||||
role: "read",
|
||||
db: "statistics",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
db.createUser({
|
||||
user: "stats_user",
|
||||
pwd: "@z^VFhN7q%vzit",
|
||||
roles: [
|
||||
{
|
||||
role: 'statsReadWrite',
|
||||
db: 'statistics',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
db.createCollection("peertube");
|
Reference in New Issue
Block a user