-
Notifications
You must be signed in to change notification settings - Fork 150
/
docker-compose.yml
89 lines (81 loc) · 2.19 KB
/
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
# Reference for exteranl_links and bridge containers
# https://blog.virtualzone.de/2016/09/docker-compose-link-containers-outside-compose-file-using-external_links.html
x-promgen-env: &x-promgen-env
CELERY_BROKER_URL: redis://redis:6379/0
DATABASE_URL: mysql://promgen:promgen@mysql:3306/promgen
SECRET_KEY: docker-compose-demo
DEBUG: 1
version: "2"
services:
web:
build: .
image: line/promgen
command: web -b 0.0.0.0:8000
environment:
<<: *x-promgen-env
ports:
- "8080:8000"
links:
- mysql
- redis
worker:
image: line/promgen
# For our demo, we'll have the worker listen both on the
# default celery queue (for notification processing) and
# on the prometheus queue (for deploying targets/etc)
command: worker -l debug --queues prometheus,celery
environment:
<<: *x-promgen-env
links:
- prometheus
- mysql
- redis
volumes:
- ./docker:/etc/prometheus
prometheus:
image: prom/prometheus
links:
- alertmanager
- blackbox
ports:
- "9090:9090"
# We need to repeat some of the default options and also add lifecycle
# so that we can call to reload Prometheus
command: >
--config.file=/etc/prometheus/prometheus.yml
--log.level=info
--storage.tsdb.path=/prometheus
--web.console.libraries=/usr/share/prometheus/console_libraries
--web.console.templates=/usr/share/prometheus/consoles
--web.enable-lifecycle
volumes:
- ./docker:/etc/prometheus
- ./docker/prom_data:/prometheus
blackbox:
image: prom/blackbox-exporter
network_mode: bridge
volumes:
- ./docker:/etc/prometheus
alertmanager:
image: prom/alertmanager
links:
- web
ports:
- "9093:9093"
command: >
--config.file=/etc/alertmanager/alertmanager.yml
--log.level=info
volumes:
- ./docker:/etc/prometheus
mysql:
image: mysql:8
command: --mysql-native-password=ON
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: promgen
MYSQL_USER: promgen
MYSQL_PASSWORD: promgen
volumes:
- ./docker/mysql_data:/var/lib/mysql
redis:
image: redis