-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (101 loc) · 2.86 KB
/
docker-compose.yml
File metadata and controls
109 lines (101 loc) · 2.86 KB
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
services:
server:
container_name: bme680-server
build: .
privileged: true
environment:
- PYTHONUNBUFFERED=1
depends_on:
- influxdb
restart: unless-stopped
networks:
- bme680-network
influxdb:
image: influxdb:2.7-alpine
container_name: bme680-influxdb
ports:
- "8086:8086"
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USERNAME}
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=${INFLUXDB_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${INFLUXDB_BUCKET}
- DOCKER_INFLUXDB_INIT_RETENTION=30d
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN}
volumes:
- influxdb-data:/var/lib/influxdb2
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8086/health"]
networks:
- bme680-network
influxdb_cli:
image: influxdb:2.7-alpine
container_name: bme680-influxdb-cli
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USERNAME}
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=${INFLUXDB_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${INFLUXDB_BUCKET}
- DOCKER_INFLUXDB_INIT_RETENTION=30d
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN}
entrypoint: >
/bin/sh -c "
influx bucket create --skip-verify --name ${INFLUXDB_TELEGRAF_BUCKET} --retention 30d --org ${INFLUXDB_ORG} --host http://influxdb:8086 --token ${INFLUXDB_ADMIN_TOKEN} ||
if [ \$? -eq 1 ]; then echo 'Bucket already exists, ignoring error.'; else exit 1; fi
"
restart: on-failure
depends_on:
- influxdb
networks:
- bme680-network
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USERNAME}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
volumes:
- grafana-data:/var/lib/grafana
restart: unless-stopped
depends_on:
- influxdb
networks:
- bme680-network
dns:
- 8.8.8.8
- 8.8.4.4
telegraf:
image: telegraf:latest
container_name: telegraf
privileged: true
ports:
- "8125:8125"
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /:/hostfs:ro
environment:
- HOST_ETC=/hostfs/etc
- HOST_PROC=/hostfs/proc
- HOST_SYS=/hostfs/sys
- HOST_VAR=/hostfs/var
- HOST_RUN=/hostfs/run
- HOST_MOUNT_PREFIX=/hostfs
restart: unless-stopped
env_file:
- .env
depends_on:
- influxdb
- influxdb_cli
networks:
- bme680-network
volumes:
influxdb-data:
grafana-data:
networks:
bme680-network:
external: false
name: bme680-network