-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
18 lines (16 loc) · 816 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.PHONY: up
up:
chmod 400 config/mongo-replication.key
sudo chown 999:999 config/mongo-replication.key
docker compose up -d
.PHONY: init
init:
docker compose exec mongo_node_1 mongosh --eval 'load ("/data/config/init-replica-set.js")' || true
@echo -e "Wait init replicaSet" && sleep 10
docker compose exec mongo_node_1 mongosh --eval '"rs.status()"' || true
docker compose exec mongo_node_1 mongosh --eval 'load ("/data/config/init-user.js")' || true
docker compose exec mongo_node_1 mongosh mongodb://mdb_admin:[email protected]:27017,170.17.5.6:27017,170.17.5.7:27017/?replicaSet=my_mdb_rs --eval '"rs.status()"'
@echo -e "Your Connection String:\n'mongosh mongodb://mdb_admin:[email protected]:27017,170.17.5.6:27017,170.17.5.7:27017/?replicaSet=my_mdb_rs'"
.PHONY: down
down:
docker compose down