Skip to content

Commit

Permalink
Fix: api app mongodb executor (#15)
Browse files Browse the repository at this point in the history
* fix(mongodb-executors-plugin): add better error handling for intuitive statuses

* fix(api-app): add persistence to config

* fix(api-app): add database config

* fix(api-app): add database config
  • Loading branch information
trentschnee authored Nov 5, 2023
1 parent 7f0534c commit 7f6b7de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
5 changes: 2 additions & 3 deletions apps/api-app/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ services:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: root-db
MONGO_INITDB_ROOT_PASSWORD: zPETms
volumes:
- medijolt-db:/data/db
- ./docker-entrypoint-initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
volumes:
medijolt-db: # Persistent volume for MongoDB data
medijolt-db: # Persistent volume for MongoDB data
24 changes: 4 additions & 20 deletions apps/api-app/docker/docker-entrypoint-initdb.d/mongo-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,11 @@ print(
'Start #################################################################'
);

db = db.getSiblingDB('api_prod_db');
db = db.getSiblingDB('medijolt_db');
db.createUser({
user: 'api_user',
pwd: 'api1234',
roles: [{ role: 'readWrite', db: 'api_prod_db' }],
});
db.createCollection('users');

db = db.getSiblingDB('api_dev_db');
db.createUser({
user: 'api_user',
pwd: 'api1234',
roles: [{ role: 'readWrite', db: 'api_dev_db' }],
});
db.createCollection('users');

db = db.getSiblingDB('api_test_db');
db.createUser({
user: 'api_user',
pwd: 'api1234',
roles: [{ role: 'readWrite', db: 'api_test_db' }],
user: 'medijolt_db_user',
pwd: 'PRuEpa',
roles: [{ role: 'readWrite', db: 'medijolt_db' }],
});
db.createCollection('users');

Expand Down

0 comments on commit 7f6b7de

Please sign in to comment.