-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
254 lines (238 loc) · 6.12 KB
/
docker-compose.yaml
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
version: '3.8'
services:
client_server:
build: ./Client-Server/
ports:
- "3001"
restart: always
container_name: client_server
environment:
- PORT=3001
- MONGOURL_USER=mongodb://rootuser:rootuser@mongodb:27017/db?authSource=admin
- Patient_JWT_LIFETIME=30d
- Patient_JWT_SECRET_KEY=VaibhavYadav
- POSTGRES_HOST=postgres
- POSTGRES_USER=rootuser
- POSTGRES_PASS=rootuser
- POSTGRES_PORT=5432
- POSTGRES_DIALECT=postgres
- MAX_REQUESTS=10
- WINDOW_SIZE_IN_SECONDS=10
- REDIS_HOST=redis
- REDIS_PORT=6379
- RABBITMQ_URL=amqp://rootuser:rootuser@rabbitmq:5672/
networks:
- app_network
deploy:
replicas: 1
depends_on:
mongodb:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
postgres:
condition: service_healthy
healthcare_server:
build: ./Healthcare-Server/
container_name: healthcare_server
ports:
- "3002"
restart: always
networks:
- app_network
deploy:
replicas: 1
depends_on:
mongodb:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
postgres:
condition: service_healthy
worker:
build: ./Worker/
restart: always
container_name: worker_service
networks:
- app_network
environment:
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_PORT=5672
- RABBITMQ_USER=rootuser
- RABBITMQ_PASSWORD=rootuser
- MONGODB_URL=mongodb://rootuser:rootuser@mongodb:27017?authSource=admin
- MONGODB_USER=rootuser
- MONGODB_PASSWORD=rootuser
- POSTGRESQL_HOST=postgres
- POSTGRESQL_USER=rootuser
- POSTGRESQL_PASSWORD=rootuser
- POSTGRESQL_PORT=5432
- POSTGRESQL_DB=postgres
- POSTGRESQL_URL=postgres://rootuser:rootuser@postgres:5432/postgres?sslmode=disable
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=465
- SMTP_EMAIL=<your-email>
- SMTP_PASSWORD=<your-one-time-password>
deploy:
replicas: 1
depends_on:
mongodb:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
postgres:
condition: service_healthy
mongodb:
image: mongo:latest
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: rootuser
MONGO_INITDB_ROOT_PASSWORD: rootuser
volumes:
- mongodb_data:/data/db
networks:
- app_network
healthcheck:
test: mongosh --eval "db.adminCommand('ping')" --quiet
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:latest
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: rootuser
POSTGRES_PASSWORD: rootuser
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app_network
healthcheck:
test: ["CMD", "pg_isready", "-U", "rootuser", "-h", "localhost", "-d", "postgres"]
interval: 10s
timeout: 10s
retries: 5
rabbitmq:
image: rabbitmq:management
restart: always
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: rootuser
RABBITMQ_DEFAULT_PASS: rootuser
volumes:
- rabbitmq_data:/var/lib/rabbitmq
networks:
- app_network
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 10s
timeout: 10s
retries: 5
redis:
image: redis:latest
restart: always
container_name: redis-server
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- app_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 10s
retries: 5
prometheus:
image: prom/prometheus:v2.30.3
ports:
- "9090:9090"
volumes:
- ./Worker/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- app_network
grafana:
image: grafana/grafana:8.2.2
ports:
- "3000:3000"
volumes:
# make sure that not singular(dashboard aka without (s)) name is present
- ./Worker/monitoring/grafana/dashboards:/var/lib/grafana/dashboards
- ./Worker/monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./Worker/monitoring/grafana/data:/var/lib/grafana
- ./Worker/monitoring/grafana/logs:/var/log/grafana
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
networks:
- app_network
depends_on:
- prometheus
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
ports:
- "8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
networks:
- app_network
node_exporter:
image: prom/node-exporter:latest
ports:
- "9100"
networks:
- app_network
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)"'
nginx:
image: nginx
restart: always
container_name: nginx
command: /bin/sh -c "nginx -g 'daemon off;' && nginx -s reload"
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./static_healthcare:/usr/share/nginx/html/healthcare:ro
- ./static_client:/usr/share/nginx/html/client:ro
depends_on:
- healthcare_server
- client_server
networks:
- app_network
volumes:
mongodb_data:
postgres_data:
rabbitmq_data:
redis-data:
networks:
app_network:
driver: bridge