-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
144 lines (136 loc) · 4.6 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
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
version: '3.1'
services:
mongo:
image: mongo
container_name: "mongodb"
ports:
- "27017:27017"
volumes:
- ./data/mongo:/data/db
- ./script/mongo/:/docker-entrypoint-initdb.d/
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
- MONGO_HOST=${MONGO_HOST}
- MONGO_PORT=${MONGO_PORT}
- MONGO_ROOT_USER=${MONGO_ROOT_USERNAME}
- MONGO_ROOT_PASS=${MONGO_ROOT_PASSWORD}
- APP_MONGO_USER=${APP_MONGO_USER}
- APP_MONGO_PASS=${APP_MONGO_PASS}
- APP_MONGO_DB=${APP_MONGO_DB}
biasimpacter:
env_file: .env
container_name: biasimpacter
build:
context: ./biasimpacter
depends_on:
- mongo
volumes:
- .:/biasimpacter
user: root
entrypoint: sh /biasimpacter/biasimpacter/crontab.sh
prometheus:
image: prom/prometheus:latest
user: root
container_name: monitoring_prometheus
restart: unless-stopped
volumes:
- ./prometheus/config:/etc/prometheus/
- ./prometheus/data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
expose:
- 9090
ports:
- 9090:9090
links:
- cadvisor:cadvisor
- node-exporter:node-exporter
node-exporter:
image: prom/node-exporter:latest
user: root
container_name: monitoring_node_exporter
restart: unless-stopped
expose:
- 9100
cadvisor:
image: google/cadvisor:latest
container_name: monitoring_cadvisor
restart: unless-stopped
user: root
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
expose:
- 8080
grafana:
env_file: .env
user: root
image: grafana/grafana:latest
container_name: monitoring_grafana
restart: unless-stopped
links:
- prometheus:prometheus
volumes:
- ./data/grafana:/var/lib/grafana
ports:
- "3000:3000"
elk:
image: sebp/elk
ports:
- "5601:5601"
- "9200:9200"
- "5044:5044"
environment:
- ES_CONNECT_RETRY=90
restart: on-failure
#Filebeat container
filebeat:
container_name: filebeat
hostname: filebeat
user: root #To read the docker socket
image: "docker.elastic.co/beats/filebeat:6.7.1"
volumes:
#Mount the Filebeat configuration so users can make edits.
- ./elk/beats/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml
#Mount the prospectors directory. Users can in turn add propspectors to this directory and they will be dynamically loaded.
- ./elk/beats/filebeat/prospectors.d/:/usr/share/filebeat/prospectors.d/
#Mount the hosts system log directory. This represents the logs of the VM hosting docker. Consumed by the Filebeat system module.
- /private/var/log/:/var/log/host/:ro
#Mount the Docker logs for indexing by the custom prospector ./config/filebeat/prospectors.d.
- /var/lib/docker/containers:/hostfs/var/lib/docker/containers
#Named volume fsdata. This is used to persist the registry file between restarts, so to avoid data duplication.
- filebeatdata:/usr/share/filebeat/data/
#Allows us to report on docker from the hosts information.
- /var/run/docker.sock:/var/run/docker.sock
command: filebeat -e -strict.perms=false
restart: on-failure
depends_on:
- elk
metricbeat:
container_name: metricbeat
hostname: metricbeat
user: root #To read the docker socket
image: docker.elastic.co/beats/metricbeat:6.7.1
volumes:
#Mount the metricbeat configuration so users can make edits.
- ./elk/beats/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml
#Mount the modules.d directory into the container. This allows user to potentially make changes to the modules and they will be dynamically loaded.
- ./elk/beats/metricbeat/modules.d/:/usr/share/metricbeat/modules.d/
#The commented sections below enable Metricbeat to monitor the Docker host rather than the Metricbeat container. These are used by the system module.
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
#Allows us to report on docker from the hosts information.
- /var/run/docker.sock:/var/run/docker.sock
#We mount the host filesystem so we can report on disk usage with the system module.
- /:/hostfs:ro
command: metricbeat -e -system.hostfs=/hostfs -strict.perms=false
restart: on-failure
depends_on:
- elk
volumes:
# create a persistent volume for Filebeat
filebeatdata: