steedos-platform/docker-compose.yml
2021-12-27 08:27:10 +00:00

58 lines
1.6 KiB
YAML

version: "3"
services:
steedos:
image: steedos/steedos-project-template:latest
restart: always
ports:
- "3000:3000"
volumes:
- "./docker-volumes/steedos/storage:/app/storage"
- "./.steedos:/app/.steedos"
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
- TRANSPORTER=redis://redis:6379
- CACHER=redis://redis/2
depends_on:
- mongo
- redis
redis:
image: redis:6.2.4
restart: always
command: ["/bin/sh","-c", "redis-server --save \"\" --appendonly no"]
ports:
- "6389:6379"
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