-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml.back
More file actions
107 lines (101 loc) · 2.43 KB
/
docker-compose.yaml.back
File metadata and controls
107 lines (101 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
services:
mongo1:
image: mongo:7.0
container_name: mongo1
command: --replSet rs0 --bind_ip_all
ports:
- "27017:27017"
volumes:
- mongo1-data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
mongo2:
image: mongo:7.0
container_name: mongo2
command: --replSet rs0 --bind_ip_all
ports:
- "27018:27017"
volumes:
- mongo2-data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
mongo3:
image: mongo:7.0
container_name: mongo3
command: --replSet rs0 --bind_ip_all
ports:
- "27019:27017"
volumes:
- mongo3-data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
mongo-setup:
image: mongo:7.0
restart: "no"
depends_on:
mongo1:
condition: service_healthy
mongo2:
condition: service_healthy
mongo3:
condition: service_healthy
entrypoint:
- mongosh
- --host
- mongo1 # Still connect to mongo1 internally for the setup
- --eval
- >
rs.initiate({
_id: "rs0",
members: [
{_id: 0, host: "188.213.197.250:27017"},
{_id: 1, host: "188.213.197.250:27018"},
{_id: 2, host: "188.213.197.250:27019"}
]
})
redis:
image: redis:latest
container_name: redis
command: redis-server --appendonly yes
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# --- NEW --- Web-based GUI for MongoDB
mongo-express:
image: docker.arvancloud.ir/mongo-express
restart: always
container_name: mongo-express-ui
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_SERVER: mongo1,mongo2,mongo3
ME_CONFIG_MONGODB_REPLICA_SET: rs0
ME_CONFIG_MONGODB_ENABLE_ADMIN: 'true'
ME_CONFIG_BASICAUTH_USERNAME: admin-ui
ME_CONFIG_BASICAUTH_PASSWORD: ui-password
depends_on:
mongo-setup:
condition: service_completed_successfully
volumes:
mongo1-data:
mongo2-data:
mongo3-data:
redis-data: