-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-containers-up.yml
182 lines (178 loc) · 5.61 KB
/
docker-containers-up.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
---
- name: Service in docker-compose
hosts: tag_reddit-monitoring
become: true
tasks:
- name: App
docker_service:
project_name: "{{ COMPOSE_PROJECT_NAME }}"
recreate: always
definition:
version: '3.3'
services:
source:
image: "{{USERNAME}}/source"
volumes:
- source_app:/reddit/app
post_db:
image: mongo:{{MONGO_V}}
volumes:
- post_db:/data/db
networks:
back_net:
aliases:
- comment_db
- post_db
ui:
image: "{{ USERNAME }}/ui:{{UI_V}}"
volumes:
- source_app:/reddit/app
ports:
- "{{PORT}}:9292/tcp"
networks:
- front_net
post:
image: "{{USERNAME}}/post:{{POST_V}}"
volumes:
- source_app:/reddit/app
networks:
- front_net
- back_net
comment:
image: "{{USERNAME}}/comment:{{COMMENT_V}}"
volumes:
- source_app:/reddit/app
networks:
- front_net
- back_net
volumes:
post_db: {}
source_app: {}
networks:
front_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.0.1.0/24
back_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.0.2.0/24
- name: Monitoring
docker_service:
project_name: "{{ COMPOSE_PROJECT_NAME }}"
recreate: always
definition:
version: '3.3'
services:
prometheus:
image: "{{USERNAME}}/prometheus"
ports:
- '9090:9090'
volumes:
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention=1d'
networks:
- front_net
- back_net
node-exporter:
image: prom/node-exporter:v0.15.2
user: root
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)($$|/)"'
networks:
- back_net
mongodb-exporter:
image: "{{USERNAME}}/mongodb-exporter:1.0"
command:
- '-mongodb.uri=mongodb://post_db:27017'
networks:
- back_net
blackbox-exporter:
image: prom/blackbox-exporter:v0.13.0
networks:
- front_net
- back_net
cadvisor:
image: google/cadvisor:v0.29.0
volumes:
- '/:/rootfs:ro'
- '/var/run:/var/run:rw'
- '/sys:/sys:ro'
- '/var/lib/docker/:/var/lib/docker:ro'
ports:
- '8080:8080'
networks:
- back_net
grafana:
image: "{{USERNAME}}/grafana"
volumes:
- grafana_data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=secret
depends_on:
- prometheus
ports:
- 3000:3000
networks:
- back_net
alertmanager:
image: "{{USERNAME}}/alertmanager"
command:
- '--config.file=/etc/alertmanager/config.yml'
ports:
- 9093:9093
networks:
- back_net
telegraf:
image: "{{USERNAME}}/telegraf"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- back_net
stackdriver-exporter:
image: frodenas/stackdriver-exporter
environment:
GOOGLE_APPLICATION_CREDENTIALS: /run/secrets/GOOGLE_APPLICATION_CREDENTIALS
STACKDRIVER_EXPORTER_GOOGLE_PROJECT_ID: "{{STACKDRIVER_EXPORTER_GOOGLE_PROJECT_ID}}"
STACKDRIVER_EXPORTER_MONITORING_METRICS_TYPE_PREFIXES: "{{STACKDRIVER_EXPORTER_MONITORING_METRICS_TYPE_PREFIXES}}"
secrets:
- GOOGLE_APPLICATION_CREDENTIALS
networks:
- back_net
trickster:
image: "{{USERNAME}}/trickster"
networks:
- back_net
secrets:
GOOGLE_APPLICATION_CREDENTIALS:
file: /home/{{ deploy_user }}/gce_creds/GOOGLE_JSON
volumes:
prometheus_data: {}
grafana_data: {}
networks:
front_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.0.1.0/24
back_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.0.2.0/24