-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-ha.yml
234 lines (220 loc) · 5.07 KB
/
docker-compose-ha.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
###
### Full config with HA
###
version: "3.7"
### NETWORKS
networks:
backend:
driver: bridge
ipam:
config:
- subnet: 172.88.88.0/24
default:
driver: bridge
### SERVICES
services:
# Portainer CE - WebUI for Containers
portainer-ce:
container_name: portainer-ce
image: portainer/portainer-ce:latest
restart: unless-stopped
command: -H unix:///var/run/docker.sock
networks:
- backend
security_opt:
- apparmor:unconfined
ports:
- "8000:8000"
- "9000:9000"
volumes:
- /etc/timezone:/etc/timezone:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${STACKDIR}/portainer/data:/data # Change to local directory if you want to save/transfer config locally
env_file:
- .env
environment:
- TZ=${TZ}
logging:
options:
max-size: "5m"
max-file: "3"
# Mosquitto - MQTT Broker
# Create mosquitto.conf, passwd, mosquitto.log files and set permissions to 775 user:docker
mosquitto:
container_name: mosquitto
image: eclipse-mosquitto:latest
user: "1883:1883"
restart: unless-stopped
security_opt:
- apparmor:unconfined
networks:
- backend
ports:
- "1883:1883" #http
- "9001:9001" #websockets
# - "8883:8883" #https
volumes:
- /etc/timezone:/etc/timezone:ro
- ${STACKDIR}/mosquitto/config:/mosquitto/config
- ${STACKDIR}/mosquitto/data:/mosquitto/data
- ${STACKDIR}/mosquitto/log:/mosquitto/log
- ${STACKDIR}/shared:/shared
env_file:
- .env
- mqtt.env
environment:
PUID: $PUID
PGID: $PGID
TZ: $TZ
logging:
options:
max-size: "5m"
max-file: "3"
# HomeAssistant
homeassistant:
container_name: homeassistant
restart: unless-stopped
image: homeassistant/home-assistant:stable
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
- /dev/ttyUSB1:/dev/ttyUSB1
- /dev/ttyACM0:/dev/ttyACM0
volumes:
- /etc/timezone:/etc/timezone:ro
- ${STACKDIR}/homeassistant:/config
- ${STACKDIR}/shared:/shared
networks:
- backend
ports:
- "8123:8123"
privileged: true
depends_on:
- mosquitto
- influxdb
env_file:
- .env
environment:
- PUID=${PUID}
- PGID=${PGID}
- TZ=${TZ}
logging:
options:
max-size: "5m"
max-file: "3"
# Telegraf
telegraf:
container_name: telegraf
image: telegraf:latest
restart: unless-stopped
user: "${PUID}:${PGID}"
volumes:
- /etc/timezone:/etc/timezone:ro
- ${STACKDIR}/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- ${STACKDIR}/telegraf/telegraf.log:/var/log/telegraf/telegraf.log
depends_on:
- influxdb
- mosquitto
networks:
- backend
environment:
- TZ=${TZ}
logging:
options:
max-size: "5m"
max-file: "3"
# Grafana - Graphical data visualization for InfluxDB data
grafana:
container_name: grafana
image: grafana/grafana:8.5.4
restart: unless-stopped
networks:
- backend
security_opt:
- apparmor:unconfined
ports:
- "3000:3000"
user: "0"
volumes:
- /etc/timezone:/etc/timezone:ro
- ${STACKDIR}/grafana:/var/lib/grafana
depends_on:
- influxdb
env_file:
- .env
environment:
- TZ=${TZ}
logging:
options:
max-size: "5m"
max-file: "3"
### DATABASE
# InfluxDB - Database for sensor data
# Create influxdb.conf first
influxdb:
container_name: influxdb
image: influxdb:1.8
restart: unless-stopped
security_opt:
- apparmor:unconfined
networks:
- backend
ports:
- "8086:8086"
- "8088:8088"
volumes:
- /etc/timezone:/etc/timezone:ro
- ${STACKDIR}/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf
- ${STACKDIR}/influxdb/db:/var/lib/influxdb
env_file:
- .env
- influxdb.env
environment:
- TZ=${TZ}
logging:
options:
max-size: "5m"
max-file: "3"
timeseriesadmin:
image: timeseriesadmin/timeseriesadmin:latest
container_name: timeseriesadmin
restart: unless-stopped
security_opt:
- apparmor:unconfined
networks:
- backend
ports:
- "8085:80"
volumes:
- /etc/timezone:/etc/timezone:ro
env_file:
- .env
environment:
- TZ=${TZ}
logging:
options:
max-size: "5m"
max-file: "3"
# Zigbee2MQTT
zigbee2mqtt:
image: koenkk/zigbee2mqtt
container_name: zigbee2mqtt
restart: unless-stopped
security_opt:
- apparmor:unconfined
networks:
- backend
ports:
# Frontend port
- 8080:8080
env_file:
- .env
- zigbee_dongle.env
volumes:
- /etc/timezone:/etc/timezone:ro
- ${STACKDIR}/zigbee2mqtt/data:/app/data
- /run/udev:/run/udev:ro
environment:
- TZ=${TZ}
devices:
# Make sure this matched your adapter location defined in 'zigbee_dongle.env'
- /dev/serial/by-id/${ZIGBEE_DONGLE_SERIALID}:/dev/ttyACM0