-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
55 lines (52 loc) · 1.13 KB
/
docker-compose.yaml
File metadata and controls
55 lines (52 loc) · 1.13 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
---
version: "3.9"
services:
bot:
build: .
restart: unless-stopped
depends_on:
- mongodb
mongodb:
build: ./src/mongo
restart: unless-stopped
volumes:
- mongodata:/data/db
- mongoconfig:/data/configdb
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASS}
MONGO_INITDB_DATABASE: data
MONGO_DATA_DIR: /data/db
MONGODB_LOG_DIR: /dev/null
command: ["--replSet", "pibotReplicaSet"]
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: >-
echo "
try {
rs.status()
} catch (err) {
rs.initiate(
{
_id:'pibotReplicaSet',
members:[
{
_id:0,
host:'host.docker.internal:27017'
}
]
}
)
}" |
mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 30
ports:
- 27017:27017
volumes:
mongodata:
mongoconfig: