forked from mpous/ming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
144 lines (136 loc) · 5.11 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: '2'
volumes:
node-red-data:
grafana-data:
influxdb-data:
influxdb-etc:
services:
# ------------------------------------------------------------------------------------
# BalenaLabs WiFi-Connect
# ------------------------------------------------------------------------------------
wifi-connect:
image: bh.cr/balenalabs/wifi-connect-rpi
container_name: wifi-connect
network_mode: host
labels:
io.balena.features.dbus: '1'
io.balena.features.firmware: '1'
cap_add:
- NET_ADMIN
environment:
DBUS_SYSTEM_BUS_ADDRESS: "unix:path=/host/run/dbus/system_bus_socket"
# ------------------------------------------------------------------------------------
# Node-RED
# ------------------------------------------------------------------------------------
node-red:
image: bh.cr/balenalabs/balena-node-red-aarch64
container_name: node-red
privileged: true
restart: unless-stopped
volumes:
- 'node-red-data:/data'
labels:
# Enable traefik support for this container
- "traefik.enable=true"
# Set service port
- "traefik.http.services.node-red.loadbalancer.server.port=80"
# Make it available on the "web" entrypoint which is defined below as :80
- "traefik.http.routers.node-red.entrypoints=web"
# Add a specific path prefix that will be expected on the URL suffix
- "traefik.http.routers.node-red.rule=PathPrefix(`/node-red`)"
- "traefik.http.middlewares.strip-node-red-prefix.stripprefix.forceSlash=false"
- "traefik.http.routers.node-red.middlewares=strip-node-red-prefix"
- "io.balena.features.dbus=true"
- "io.balena.features.sysfs=true"
- "io.balena.features.supervisor-api=true"
- "io.balena.features.balena-api=true"
environment:
PORT: 80
USERNAME: "balena"
PASSWORD: "balena"
ENCRIPTION_KEY: "balena"
cap_add:
- SYS_RAWIO
devices:
- "/dev/mem:/dev/mem"
- "/dev/gpiomem:/dev/gpiomem"
depends_on:
influxdb:
condition: service_started
reverse-proxy:
condition: service_started
# ------------------------------------------------------------------------------------
# MQTT
# ------------------------------------------------------------------------------------
mqtt:
image: eclipse-mosquitto:1.6.15
container_name: mqtt
ports:
- "1883:1883"
restart: always
# ------------------------------------------------------------------------------------
# Influxdb
# ------------------------------------------------------------------------------------
influxdb:
image: influxdb:1.7.11
container_name: influxdb
restart: unless-stopped
volumes:
- influxdb-data:/var/lib/influxdb
- influxdb-etc:/etc/influxdb
# ------------------------------------------------------------------------------------
# Grafana
# ------------------------------------------------------------------------------------
grafana:
image: bh.cr/balenalabs/dashboard
container_name: grafana
restart: unless-stopped
volumes:
- "grafana-data:/data"
environment:
- "GF_SERVER_ROOT_URL=/grafana"
- "GF_SERVER_SERVE_FROM_SUB_PATH=true"
labels:
# Enable traefik support for this container
- "traefik.enable=true"
# Set service port
- "traefik.http.services.grafana.loadbalancer.server.port=80"
# Make it available on the "web" entrypoint which is defined below as :80
- "traefik.http.routers.grafana.entrypoints=web"
# Add a specific path prefix that will be expected on the URL suffix
- "traefik.http.routers.grafana.rule=PathPrefix(`/grafana`)"
# Redirect a request to root page to grafana service
- "traefik.http.routers.grafana-main.rule=( Path(`/`) )"
- "traefik.http.middlewares.redirect-root.redirectregex.regex=^/"
- "traefik.http.middlewares.redirect-root.redirectregex.replacement=/grafana"
- "traefik.http.routers.grafana-main.middlewares=redirect-root"
depends_on:
influxdb:
condition: service_started
reverse-proxy:
condition: service_started
# ------------------------------------------------------------------------------------
# Traefik Reverse Proxy
# ------------------------------------------------------------------------------------
reverse-proxy:
image: bh.cr/gh_ajlennon/reverse-proxy
command:
- "--log.level=DEBUG"
- "--accesslog=true"
- "--accesslog.filepath=/var/log/traefik.log"
- "--api.dashboard=true"
# Uncomment this to enable the Traefik WebUI on port :8080
- "--api.insecure"
- "--providers.docker=true"
- "--providers.docker.endpoint=unix:///var/run/balena-engine.sock"
#- "--providers.docker.exposedbydefault=true"
- "--entrypoints.web.address=:80"
ports:
# The HTTP port
- "80:80"
# The Dashboard port
- "8080:8080"
labels:
# So that Traefik can listen to the Docker events
io.balena.features.balena-socket: '1'
restart: always