mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 11:46:23 +00:00
Enable Docker Replication Sets (#15298)
- Enable docker replication sets using command - Initialize replication set using heartbeat and then use replication set status as heartbeat. - Prevent client from starting until mongo is in a state stable for connections.
This commit is contained in:
parent
0542008b7f
commit
1df8d5832f
1 changed files with 12 additions and 2 deletions
|
|
@ -22,7 +22,8 @@ services:
|
||||||
dockerfile: ./Dockerfile-Dev
|
dockerfile: ./Dockerfile-Dev
|
||||||
command: ["npm", "start"]
|
command: ["npm", "start"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongo
|
mongo:
|
||||||
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
- NODE_DB_URI=mongodb://mongo/habitrpg
|
- NODE_DB_URI=mongodb://mongo/habitrpg
|
||||||
networks:
|
networks:
|
||||||
|
|
@ -33,7 +34,16 @@ services:
|
||||||
- .:/usr/src/habitica
|
- .:/usr/src/habitica
|
||||||
- /usr/src/habitica/node_modules
|
- /usr/src/habitica/node_modules
|
||||||
mongo:
|
mongo:
|
||||||
image: mongo:3.6
|
image: mongo:5.0.23
|
||||||
|
restart: unless-stopped
|
||||||
|
command: ["--replSet", "rs", "--bind_ip_all", "--port", "27017"]
|
||||||
|
healthcheck:
|
||||||
|
test: echo "try { rs.status() } catch (err) { rs.initiate() }" | mongosh --port 27017 --quiet
|
||||||
|
interval: 10s
|
||||||
|
timeout: 30s
|
||||||
|
start_period: 0s
|
||||||
|
start_interval: 1s
|
||||||
|
retries: 30
|
||||||
networks:
|
networks:
|
||||||
- habitica
|
- habitica
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue