-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
73 lines (68 loc) · 2.13 KB
/
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
# https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/#run-grafana-via-docker-compose
# https://docs.influxdata.com/influxdb/v2/install/use-docker-compose
# https://pimylifeup.com/mosquitto-mqtt-docker
name: zimmer-wetter
services:
# ############################# #
# Mosquitto MQTT Broker #
# ############################# #
broker:
image: eclipse-mosquitto:2
container_name: mosquitto
restart: on-failure:5
ports:
- 1883:1883
- 9001:9001
volumes:
- ./docker/conf-mosquitto:/mosquitto/config
- ./docker/data-mosquitto:/mosquitto/data
- ./docker/logs-mosquitto:/mosquitto/logs
stdin_open: true
tty: true
# ############################# #
# InfluxDB Time-Series Database #
# ############################# #
database:
image: influxdb:2.7-alpine
container_name: influxdb
restart: on-failure:5
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN}
DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUXDB_USERNAME}
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD}
DOCKER_INFLUXDB_INIT_BUCKET: weather_data
DOCKER_INFLUXDB_INIT_RETENTION: 1w
ports:
- 8086:8086
volumes:
- ./docker/conf-influxdb:/etc/influxdb2
- ./docker/data-influxdb:/var/lib/influxdb2
healthcheck:
test: wget --no-verbose --tries=1 --output-document=/dev/null http://0.0.0.0:8086/ &> /dev/null || exit 1
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
# ############################# #
# MQTT-to-Influx ETL Pipeline #
# ############################# #
pipeline:
build: ./etl-pipeline
container_name: etl-pipeline
restart: on-failure:5
environment:
INFLUXDB_V2_URL: http://database:8086
INFLUXDB_V2_ORG: ${INFLUXDB_ORG}
INFLUXDB_V2_TOKEN: ${INFLUXDB_TOKEN}
INFLUXDB_V2_TIMEOUT: 6000
depends_on:
- database
- broker
mock:
build: ./mock-station
container_name: mock-station
restart: on-failure:5
depends_on:
- broker