-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
43 lines (39 loc) · 962 Bytes
/
compose.yml
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
version: '3.8'
services:
mongo:
image: mongo:latest
command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27017" ]
ports:
- "27017:27017"
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:27017'}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
retries: 30
volumes:
- "mongo_data:/data/db"
- "mongo_config:/data/configdb"
networks:
- mynetwork
postgres:
image: postgres:latest
environment:
POSTGRES_DB: scdf
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- mynetwork
volumes:
mongo_data:
mongo_config:
postgres_data:
networks:
mynetwork:
driver: bridge