Skip to content

Commit

Permalink
Add replicaset to mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
cruizba committed Nov 27, 2024
1 parent 8c07f8f commit 9bd0764
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
openvidu:
analytics:
enabled: true
mongo_url: mongodb://localhost:27017/
mongo_url: mongodb://localhost:27017/?replicaSet=rs0&readPreference=primaryPreferred
interval: 10s
expiration: 360h # 15 days

Expand Down
13 changes: 9 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,29 @@ services:
- redis:/data

mongo:
image: mongo:latest
image: docker.io/bitnami/mongodb:latest
container_name: mongo
ports:
- 27017:27017
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongo
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_REPLICA_SET_NAME=rs0
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- mongo-configdb:/data/configdb
- mongo-db:/data/db
- mongo-db:/bitnami/mongodb

mongo-express:
image: mongo-express
container_name: mongo-express
environment:
- ME_CONFIG_BASICAUTH_USERNAME=admin
- ME_CONFIG_BASICAUTH_PASSWORD=pass
- ME_CONFIG_MONGODB_URL=mongodb://mongo:27017/?replicaSet=rs0&readPreference=primaryPreferred
depends_on:
- mongo
ports:
- 8081:8081
- 8082:8081

volumes:
redis:
Expand Down

0 comments on commit 9bd0764

Please sign in to comment.