-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
76 lines (66 loc) · 1.96 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
version: "2.4"
services:
grafana:
image: grafana/grafana:6.7.4
restart: on-failure
volumes:
- ./provisioning/grafana/:/etc/grafana/provisioning/
# Grant admin rights to anon user
- ./provisioning/grafana/grafana.ini:/etc/grafana/grafana.ini
environment:
GF_SECURITY_ADMIN_USER: 1
GF_SECURITY_ADMIN_PASSWORD: 1
GF_SECURITY_DISABLE_GRAVATAR: "true"
GF_DATABASE_TYPE: mysql
GF_DATABASE_HOST: db:3306
GF_DATABASE_NAME: grafana
GF_DATABASE_USER: grafana
GF_DATABASE_PASSWORD: password
GF_SESSION_PROVIDER: mysql
GF_SESSION_PROVIDER_CONFIG: grafana:password@tcp(db:3306)/grafana?allowNativePasswords=true
GF_DATABASE_MAX_OPEN_CONN: 100
GF_AUTH_ANONYMOUS_ENABLED: "true"
ports:
- 80:3000/tcp
depends_on:
db:
condition: service_healthy
db:
image: mysql:5.6
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: grafana
MYSQL_USER: grafana
MYSQL_PASSWORD: password
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb_monitor_enable=all, --max-connections=1001]
ports:
- 3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 5s
retries: 20
volumes:
- grafana-settings:/var/lib/mysql
set_default_dashboard:
image: arey/mysql-client
restart: on-failure
command: -h db -u grafana -ppassword -D grafana -e "REPLACE INTO preferences(id,org_id,home_dashboard_id,team_id) VALUES(1,1,1,0);"
depends_on:
db:
condition: service_healthy
influxdb:
image: influxdb:1.8.0-alpine
restart: on-failure
expose:
- 8086
container_name: influxdb
volumes:
- sensors-data:/var/lib/influxdb
environment:
INFLUXDB_DB: sensors
INFLUXDB_READ_USER: influx
INFLUXDB_READ_PASSWORD: influx
volumes:
grafana-settings:
sensors-data: