mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-24 15:26:46 -05:00
Set up MongoDB as a single-server replication set
This is necessary because the account server uses transactions, which only work in a replication set.
This commit is contained in:
parent
a82ecdae31
commit
1d6f6a9f59
|
|
@ -53,6 +53,12 @@ services:
|
|||
# For connecting with mongosh or MongoDB Compass
|
||||
- 127.0.0.1:27017:27017
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./config/mongod.conf
|
||||
target: /etc/mongod.conf
|
||||
- type: bind
|
||||
source: ./config/mongodb-init.js
|
||||
target: /docker-entrypoint-initdb.d/init.js
|
||||
- type: volume
|
||||
source: mongodb-database
|
||||
target: /data/db
|
||||
|
|
|
|||
10
config/mongod.conf
Normal file
10
config/mongod.conf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
storage:
|
||||
dbPath: /data/db
|
||||
|
||||
net:
|
||||
port: 27017
|
||||
bindIp: 0.0.0.0
|
||||
|
||||
replication:
|
||||
oplogSizeMB: 2000
|
||||
replSetName: rs
|
||||
1
config/mongodb-init.js
Normal file
1
config/mongodb-init.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
rs.initiate();
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
GENERATE_NEW_KEYS=true
|
||||
PN_ACT_PREFER_ENV_CONFIG=true
|
||||
PN_ACT_CONFIG_HTTP_PORT=8080
|
||||
PN_ACT_CONFIG_MONGO_CONNECTION_STRING=mongodb://mongodb:27017/pretendo_account
|
||||
PN_ACT_CONFIG_MONGO_CONNECTION_STRING=mongodb://mongodb:27017/pretendo_account?replicaSet=rs&directConnection=true
|
||||
PN_ACT_CONFIG_MONGOOSE_OPTION_useNewUrlParser=true
|
||||
PN_ACT_CONFIG_MONGOOSE_OPTION_useUnifiedTopology=true
|
||||
PN_ACT_CONFIG_S3_ENDPOINT=http://minio:9000
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user