-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-minimal.yml
157 lines (145 loc) · 3.38 KB
/
docker-compose-minimal.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
###
### Minimal smart home stack config
###
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"
# 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"