-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprod.docker-compose.yml
194 lines (177 loc) · 4.02 KB
/
prod.docker-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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
version: "3"
services:
nuxt:
build: ./frontend/nuxt-fe
restart: on-failure
container_name: nuxt-app
restart: always
ports:
- "3000:3000"
depends_on:
- apihub
- mongodb1
- mongodb2
# volumes:
# - ./frontend/nuxt-fe:/app
command: npm run start
networks:
- knowlix_net
nginx:
build: ./nginx/
networks:
- knowlix_net
container_name: nginx
ports:
- "80:80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- nuxt
- mongodb1
- mongodb2
celery:
container_name: celery
build: ./celery/
volumes:
- ./celery/server.py:/celery/server.py
- ./celery/worker.py:/celery/worker.py
- pptxdecks:/celery/output
environment:
MONGODB: mongodb://mongodb2
RABBITMQ: pyamqp://rabbitmq
networks:
- knowlix_net
depends_on:
- mongodb1
- mongodb2
- rabbitmq
celery-beat:
container_name: celery-beat
build: ./celery-beat/
volumes:
- pptxdecks:/celery-beat/output
environment:
MONGODB: mongodb://mongodb2
RABBITMQ: pyamqp://rabbitmq
networks:
- knowlix_net
entrypoint:
- /celery-beat/beat.sh
depends_on:
- mongodb1
- mongodb2
- rabbitmq
- celery
mongo-stream:
container_name: mongo-stream
restart: on-failure
build: ./mongo-stream/
command: python3 -u server.py
environment:
MONGODB: mongodb://mongodb2
ports:
- "3333:3333"
depends_on:
- mongo-startup
- mongodb1
- mongodb2
volumes:
- ./mongo-stream/server.py:/usr/app/server.py
networks:
- knowlix_net
mongodb1:
image: mongo:latest
container_name: db-replica1
networks:
- knowlix_net
ports:
- 30001:27017
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongodb2:
image: mongo:latest
container_name: db-replica2
volumes:
- ./db-backup/primary:/data/db
networks:
- knowlix_net
ports:
- 30002:27017
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongo-startup:
image: mongo
container_name: startup-agent
networks:
- knowlix_net
depends_on:
- mongodb1
- mongodb2
volumes:
- ./mongo-startup:/mongo-startup
entrypoint:
- /mongo-startup/initiate_replica.sh
apihub:
build: ./backend/
container_name: apihub
restart: on-failure
environment:
MONGODB: mongodb://mongodb2
RABBITMQ: pyamqp://rabbitmq
volumes:
- pptxdecks:/usr/app/output
- type: bind
source: ./backend/api.py
target: /usr/app/api.py
- type: bind
source: ./backend/req.txt
target: /usr/app/req.txt
- type: bind
source: ./backend/main.py
target: /usr/app/main.py
- type: bind
source: ./backend/core.py
target: /usr/app/core.py
- type: bind
source: ./backend/server.py
target: /usr/app/server.py
- type: bind
source: ./backend/master.pptx
target: /usr/app/master.pptx
- type: bind
source: ./backend/config.py
target: /usr/app/config.py
- type: bind
source: ./backend/api_utils.py
target: /usr/app/api_utils.py
command: uvicorn --host=0.0.0.0 --port=8000 api:app --reload
ports:
- "8000:8000"
depends_on:
- mongodb1
- mongo-startup
- rabbitmq
networks:
- knowlix_net
rabbitmq:
container_name: rabbitmq
networks:
- knowlix_net
image: rabbitmq:3.8-management
ports:
- "15672:15672"
flower:
container_name: flower
image: mher/flower:0.9.5
command: ["flower", "--broker=amqp://rabbitmq", "--port=5555"]
networks:
- knowlix_net
ports:
- "5555:5555"
depends_on:
- mongodb1
- mongodb2
- rabbitmq
- celery
networks:
knowlix_net:
volumes:
pptxdecks: