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