forked from steedos/steedos-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
47 lines (44 loc) · 1.3 KB
/
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
38
39
40
41
42
43
44
45
46
47
version: "3"
services:
steedos:
image: steedos/steedos-project-template:1.23.26
restart: always
ports:
- "3000:3000"
volumes:
- "./docker-volumes/steedos/storage:/app/storage"
environment:
- PORT=3000
- ROOT_URL=http://localhost:3000
- MONGO_URL=mongodb://mongo:27017/steedos
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
- STEEDOS_CFS_STORE=local
- STEEDOS_STORAGE_DIR=/app/storage
depends_on:
- mongo
mongo:
image: mongo:4.2
restart: always
volumes:
- "./docker-volumes/mongo/data/db:/data/db"
command: mongod --oplogSize 128 --profile=1 --slowms=500 --replSet rs0 --bind_ip_all
ports:
- "27018:27017"
# this container's job is just run the command to initialize the replica set.
# it will run the command and remove himself (it will not stay running)
mongo-init-replica:
image: mongo:4.2
command: >
bash -c
"for i in `seq 1 30`; do
mongo mongo/steedos --eval \"
rs.initiate({
_id: 'rs0',
version: 1,
members: [ { _id: 0, host: 'mongo:27017' } ]})\" &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 secs...\";
sleep 5;
done; (exit $$s)"
depends_on:
- mongo