-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose-prod.yml
373 lines (362 loc) · 10.6 KB
/
docker-compose-prod.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
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
version: '3.8'
networks:
# evidssnet:
# name: evidssne
vpcbr: # virtual network name
driver: bridge
ipam:
config: # here, we define our ip space
- subnet: 10.5.0.0/16
gateway: 10.5.0.1
volumes:
prometheus_data: {}
grafana_data: {}
loki-data: {}
#configs:
# loki_config:
# file: ./dockprom/loki/config/loki.yaml
# this is a YAML anchor to avoid repetition
x-logging: &logging
logging:
driver: loki
options: # note: the ip is the ip we will assign later to loki in this file
loki-url: "http://10.5.0.2:3100/loki/api/v1/push" # https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
services:
nginx:
# logging:
# driver: loki #awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "nginx"
# loki-url: "http://loki:3100/loki/api/v1/push" #"https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
image: nginx:1.19.2
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- ./templates:/etc/nginx/templates/
- './ssl:/ssl/'
depends_on:
- evides
- resview
networks:
vpcbr :
ipv4_address: 10.5.0.3
environment:
- EVIDSSDOCS_IP=$EVIDSSDOCS_IP
- EVIDES_IP=$EVIDES_IP
- RESVIEW_IP=$RESVIEW_IP
- REDASH_IP=$REDASH_IP
- EVIDSS_DOMAINNAME=$EVIDSS_DOMAINNAME
- EVIDES_PORT=$EVIDES_PORT
- RESVIEW_PORT=$RESVIEW_PORT
- GRAFANA_PORT=$GRAFANA_PORT
- GRAFANA_IP=$GRAFANA_IP
- ALERTMANAGER_PORT=$ALERTMANAGER_PORT
- ALERTMANAGER_IP=$ALERTMANAGER_IP
- LOKI_IP=$LOKI_IP
- LOKI_PORT=$LOKI_PORT
flyway:
# logging:
# driver: loki # awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "flyway"
# loki-url: "http://loki:3100/loki/api/v1/push" # "https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
image: flyway/flyway
command: -url=jdbc:postgresql://${MAIN_HOST}:${MAIN_PORT}/${MAIN_DB} -schemas=public -user=${DBWRITE_USER} -password=${DBWRITE_PWD} migrate
volumes:
- ./database/migrations:/flyway/sql
# networks:
# - evidssnet
evides:
# logging:
# driver: loki # awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "evides"
# loki-url: "https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
build: './evides'
ports:
- '${EVIDES_PORT}:${EVIDES_PORT}'
networks:
vpcbr: # evidssnet
ipv4_address: 10.5.0.4
environment:
- GITHUB_PAT=$GITHUB_PAT
- EVIDES_PORT=$EVIDES_PORT
- AUTH0_USER=$AUTH0_USER
- AUTH0_KEY=$AUTH0_KEY
- AUTH0_SECRET=$AUTH0_SECRET
- AFDC_API_KEY=$AFDC_API_KEY
- MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN
- MAIN_USER=$DBWRITE_USER
- MAIN_PWD=$DBWRITE_PWD
- MAIN_HOST=$MAIN_HOST
- MAIN_PORT=$MAIN_PORT
- MAIN_DB=$MAIN_DB
restart: unless-stopped
resview:
# logging:
# driver: loki # awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "resview"
# awslogs-region: us-west-2
# loki-url: "https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
build: './resview'
ports:
- '${RESVIEW_PORT}:${RESVIEW_PORT}'
networks:
vpcbr:
ipv4_address: 10.5.0.5
environment:
- GITHUB_PAT=$GITHUB_PAT
- RESVIEW_PORT=$RESVIEW_PORT
- AFDC_API_KEY=$AFDC_API_KEY
- MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN
- MAIN_USER=$DBREAD_USER
- MAIN_PWD=$DBREAD_PWD
- MAIN_HOST=$MAIN_HOST
- MAIN_PORT=$MAIN_PORT
- MAIN_DB=$MAIN_DB
restart: unless-stopped
tripgen:
# logging:
# driver: loki # awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "tripgen"
# loki-url: "https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
build: './tripgen'
# networks:
# - evidssnet
environment:
- GITHUB_PAT=$GITHUB_PAT
- AFDC_API_KEY=$AFDC_API_KEY
- MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN
- MAIN_USER=$DBWRITE_USER
- MAIN_PWD=$DBWRITE_PWD
- MAIN_HOST=$MAIN_HOST
- MAIN_PORT=$MAIN_PORT
- MAIN_DB=$MAIN_DB
- SOCRATA_APP_TOKEN=$SOCRATA_APP_TOKEN
- MAILGUN_API_KEY=$MAILGUN_API_KEY
redis:
# logging:
# driver: loki # awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "redis"
# loki-url: "https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
image: 'redis:6.0.6'
volumes:
- $PWD/redis-data:/var/lib/redis
ports:
- '6379:6379'
networks:
vpcbr:
ipv4_address: 10.5.0.13
restart: always
simman:
# logging:
# driver: loki # awslogs
# options:
# awslogs-group: "cp84-evi-dss-mainEC2"
# awslogs-stream: "simman"
# loki-url: "https://${GRAFANA_CLOUD_USERNAME}:${GRAFANA_CLOUD_PWD}@${GRAFANA_CLOUD_URL}/loki/api/v1/push"
<<: *logging
build: './simman'
depends_on:
- redis
ports:
- '${SIMMAN_PORT}:${SIMMAN_PORT}'
networks:
vpcbr:
ipv4_address: 10.5.0.14
volumes:
- $HOME/.aws/credentials:/home/app/.aws/credentials:ro
environment:
- SIMMAN_PORT=$SIMMAN_PORT
- REDIS_HOST=$REDIS_HOST
- MAIN_USER=$DBWRITE_USER
- MAIN_PWD=$DBWRITE_PWD
- MAIN_HOST=$MAIN_HOST
- MAIN_PORT=$MAIN_PORT
- MAIN_DB=$MAIN_DB
- EC2_SECURITY_GROUPNAME=$EC2_SECURITY_GROUPNAME
- EC2_KEYPAIR_NAME=$EC2_KEYPAIR_NAME
- EC_R_AMI_ID=$EC_R_AMI_ID
- IAM_INSTANCE_PROFILE_ARN=$IAM_INSTANCE_PROFILE_ARN
- EC_GAMA_AMI_ID=$EC_GAMA_AMI_ID
- RESVIEW_HOST=$RESVIEW_HOST
- COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME
- DEPLOYMENT_TAG=$DEPLOYMENT_TAG
- DEPLOYMENT_BRANCH=$DEPLOYMENT_BRANCH
- EVIDSS_DOMAINNAME=$EVIDSS_DOMAINNAME
command:
- nodemon
- index.js
restart: always
#######################################################
# Dockprom containers (and Loki) - for monitoring and logging only
#######################################################
prometheus:
image: prom/prometheus:v2.24.0
container_name: prometheus
volumes:
- ./dockprom/prometheus:/etc/prometheus
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
restart: unless-stopped
expose:
- 9090
networks:
vpcbr:
ipv4_address: 10.5.0.7
labels:
org.label-schema.group: "monitoring"
alertmanager:
image: prom/alertmanager:v0.21.0
container_name: alertmanager
volumes:
- ./dockprom/alertmanager:/etc/alertmanager
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
restart: unless-stopped
# expose:
# - 9093
ports:
- '9093:9093'
networks:
vpcbr:
ipv4_address: 10.5.0.8
labels:
org.label-schema.group: "monitoring"
nodeexporter:
image: prom/node-exporter:v1.0.1
container_name: nodeexporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
restart: unless-stopped
expose:
- 9100
networks:
vpcbr:
ipv4_address: 10.5.0.9
labels:
org.label-schema.group: "monitoring"
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.38.7
container_name: cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
#- /cgroup:/cgroup:ro #doesn't work on MacOS only for Linux
restart: unless-stopped
expose:
- 8080
networks:
vpcbr:
ipv4_address: 10.5.0.10
labels:
org.label-schema.group: "monitoring"
grafana:
image: grafana/grafana:7.4.0
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
- ./dockprom/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,grafana-worldmap-panel
- GF_SERVER_HTTP_PORT=${GRAFANA_PORT}
- GF_SERVER_PROTOCOL=http
- GF_SERVER_DOMAIN=www.${EVIDSS_DOMAINNAME}
- GF_SERVER_ROOT_URL=https://www.${EVIDSS_DOMAINNAME}/grafana/
- GF_SERVER_SERVE_FROM_SUB_PATH=true
restart: unless-stopped
#expose:
# - 3000
ports:
- '3000:3000'
networks:
vpcbr: # evidssnet
ipv4_address: 10.5.0.6
labels:
org.label-schema.group: "monitoring"
pushgateway:
image: prom/pushgateway:v1.3.1
container_name: pushgateway
restart: unless-stopped
expose:
- 9091
networks:
vpcbr:
ipv4_address: 10.5.0.11
labels:
org.label-schema.group: "monitoring"
# caddy:
# image: stefanprodan/caddy
# container_name: caddy
# ports:
# - "3000:3000"
# - "9090:9090"
# - "9093:9093"
# - "9091:9091"
# volumes:
# - ./dockprom/caddy:/etc/caddy
# environment:
# - ADMIN_USER=${ADMIN_USER:-admin}
# - ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
# restart: unless-stopped
# networks:
# vpcbr:
# ipv4_address: 10.5.0.12
# labels:
# org.label-schema.group: "monitoring"
loki:
image: grafana/loki:2.0.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
restart: unless-stopped
networks:
# - evidssnet
vpcbr:
ipv4_address: 10.5.0.2
promtail:
image: grafana/promtail:latest
volumes:
- $PWD/dockprom/promtail:/etc/promtail
- /var/log:/var/log
command: -config.file=/etc/promtail/docker-config.yaml
networks:
# - evidssnet
vpcbr:
ipv4_address: 10.5.0.15