1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-11-22 02:12:30 +01:00
spacebarchat/docker-compose.yml
2021-07-15 19:23:35 +02:00

46 lines
1.2 KiB
YAML

version: "3"
services:
fosscord-gateway:
container_name: gateway
restart: always
build: gateway
ports:
- "3002:3002"
depends_on:
- mongo
env_file: ./.docker/env
fosscord-api:
container_name: api
restart: always
build: api
ports:
- "3001:3001"
depends_on:
- mongo
env_file: ./.docker/env
mongo:
container_name: mongo
image: mongo
volumes:
- ./.docker/data:/data/db
- ./.docker/mongodb/mongod.conf:/etc/mongod.conf
ports:
- "27018:27018"
command: mongod --replSet rs0 --port 27018
restart: unless-stopped
mongo-init-replica:
image: mongo
command: >
bash -c
"for i in `seq 1 30`; do
mongo mongo/fosscord --eval \"
rs.initiate({
_id: 'rs0',
members: [ { _id: 0, host: 'localhost:27018' } ]})\" &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 secs...\";
sleep 5;
done; (exit $$s)"
depends_on:
- mongo