-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
69 lines (62 loc) · 1.81 KB
/
compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
services:
backend:
build: ./backend
container_name: backend
restart: always
depends_on:
- "database"
environment:
- MONGO_DB_URI=${MONGO_DB_URI}
bot:
build: ./bot
container_name: bot
restart: always
depends_on:
- "backend"
- "database"
environment:
- BOT_TOKEN=${BOT_TOKEN}
- CLIENT_ID=${CLIENT_ID}
- MONGO_DB_URI=${MONGO_DB_URI}
frontend:
build: ./frontend
container_name: frontend
restart: always
logging:
build: ./logging
container_name: logging
restart: always
depends_on:
- "database"
environment:
- MONGO_DB_URI=${MONGO_DB_URI}
database:
build: ./init.d
restart: always
command: --bind_ip_all --keyFile /etc/mongo-keyfile --replSet rs0
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=lab
volumes:
- ./init.d:/docker-entrypoint-initdb.d/
- db:/data/db
ports:
- "27017:27017"
replicaSetup:
image: mongo
depends_on:
- database
entrypoint: ["/bin/sh","-c","sleep 4 && mongosh mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@database:27017 --eval \"rs.initiate({ _id : 'rs0', members: [{ _id: 0, host: 'database:27017' }]});\""]
nginx:
build: ./nginx
container_name: nginx
restart: always
depends_on:
- "frontend"
- "backend"
- "logging"
ports:
- "80:80"
volumes:
db: