1
0
mirror of https://github.com/spacebarchat/spacebarchat.git synced 2024-11-09 12:12:34 +01:00

Merge pull request #35 from DiegoMagdaleno/master

Docker: This allows Fosscord to run in a docker container
This commit is contained in:
Flam3rboy 2021-05-10 17:54:47 +02:00 committed by GitHub
commit b5584e8544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 52 additions and 3 deletions

0
.docker/data/.keep Normal file
View File

1
.docker/env Normal file
View File

@ -0,0 +1 @@
MONGO_URL=mongodb://mongo:27017/fosscord?readPreference=secondaryPreferred?replicaSet=rs0

View File

@ -0,0 +1,2 @@
replication:
replSetName: "rs0"

4
.gitignore vendored
View File

@ -1,2 +1,4 @@
node_modules/
.DS_STORE
.DS_STORE
.docker/data/*
!.docker/data/.keep

2
api

@ -1 +1 @@
Subproject commit 5514d1d7c500e38cede7558cb304aed7d54887b9
Subproject commit 87bbf118431bd02930dd47221ebab2cb19a86c79

44
docker-compose.yml Normal file
View File

@ -0,0 +1,44 @@
version: "3"
services:
fosscord-gateway:
container_name: gateway
restart: always
build: gateway
ports:
- "3002:3002"
links:
- mongo
env_file: ./.docker/env
fosscord-api:
container_name: api
restart: always
build: api
ports:
- "3001:3001"
links:
- mongo
env_file: ./.docker/env
mongo:
container_name: mongo
image: mongo
volumes:
- ./.docker/data:/data/db
- ./.docker/mongodb/mongod.conf:/etc/mongod.conf
ports:
- "27017:27017"
command: mongod --replSet rs0
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:27017' } ]})\" &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 secs...\";
sleep 5;
done; (exit $$s)"
links:
- mongo

@ -1 +1 @@
Subproject commit 82f9e421aafd742e839c2d6ba0d292704d04b529
Subproject commit 82e5dc8661059c712ab21cfee973ce316549f507