-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
docker-compose.yml
37 lines (37 loc) · 976 Bytes
/
docker-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
version: '3.8'
services:
mongo_opentacos:
hostname: mongodb
image: mongo:5
env_file:
- .env
ports:
- 27017:27017
volumes:
- opentacos_mongodb_data:/data/db
- ./:/opt/keyfile/
healthcheck:
test: test $$(echo "rs.initiate().ok || rs.status().ok" | mongo -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --quiet) -eq 1
interval: 10s
start_period: 30s
entrypoint:
- bash
- -c
- |
cp /opt/keyfile/keyfile /data/db/replica.key
chmod 400 /data/db/replica.key
chown 999:999 /data/db/replica.key
exec docker-entrypoint.sh $$@
command: "mongod --bind_ip_all --replSet rs0 --keyFile /data/db/replica.key"
mongosetup:
image: mongo:5
depends_on:
- mongo_opentacos
env_file:
- .env
volumes:
- .:/scripts
restart: "no"
entrypoint: [ "bash", "/scripts/mongo_setup.sh" ]
volumes:
opentacos_mongodb_data: