mirror of
https://github.com/spacebarchat/spacebarchat.git
synced 2024-11-08 19:52:36 +01:00
Merge pull request #35 from DiegoMagdaleno/master
Docker: This allows Fosscord to run in a docker container
This commit is contained in:
commit
b5584e8544
0
.docker/data/.keep
Normal file
0
.docker/data/.keep
Normal file
1
.docker/env
Normal file
1
.docker/env
Normal file
@ -0,0 +1 @@
|
||||
MONGO_URL=mongodb://mongo:27017/fosscord?readPreference=secondaryPreferred?replicaSet=rs0
|
2
.docker/mongodb/mongod.conf
Normal file
2
.docker/mongodb/mongod.conf
Normal file
@ -0,0 +1,2 @@
|
||||
replication:
|
||||
replSetName: "rs0"
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
node_modules/
|
||||
.DS_STORE
|
||||
.docker/data/*
|
||||
!.docker/data/.keep
|
2
api
2
api
@ -1 +1 @@
|
||||
Subproject commit 5514d1d7c500e38cede7558cb304aed7d54887b9
|
||||
Subproject commit 87bbf118431bd02930dd47221ebab2cb19a86c79
|
44
docker-compose.yml
Normal file
44
docker-compose.yml
Normal 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
|
2
gateway
2
gateway
@ -1 +1 @@
|
||||
Subproject commit 82f9e421aafd742e839c2d6ba0d292704d04b529
|
||||
Subproject commit 82e5dc8661059c712ab21cfee973ce316549f507
|
Loading…
Reference in New Issue
Block a user