-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
167 lines (160 loc) · 4.84 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
services:
openhab:
image: openhab/openhab:${OPENHAB_VERSION}
depends_on:
- influxdb
- mosquitto
restart: always
# if you do not need persistent log files
#tmpfs:
# - /openhab/userdata/logs
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "./data/openhab/conf:/openhab/conf"
- "./data/openhab/addons:/openhab/addons"
- data_openhab_userdata:/openhab/userdata
environment:
- TZ=${TZ}
- OPENHAB_HTTP_PORT=${OPENHAB_HTTP_PORT}
- OPENHAB_HTTPS_PORT=${OPENHAB_HTTPS_PORT}
- "CRYPTO_POLICY=unlimited"
- "EXTRA_JAVA_OPTS=-Duser.timezone=${TZ}"
# If you need more memory
#- "EXTRA_JAVA_OPTS=-Xms1024m -Xmx2048m -Duser.timezone=${TZ}"
- USER_ID=9001
- GROUP_ID=9001
labels:
- "com.centurylinklabs.watchtower.enable=true"
network_mode: host
mosquitto:
image: eclipse-mosquitto:${MOSQUITTO_VERSION}
restart: always
volumes:
- "./data/mosquitto/conf:/mosquitto/config"
- data_mosquitto_data:/mosquitto/data
- data_mosquitto_log:/mosquitto/log
ports:
- ${MOSQUITTO_MQTT_PORT}:1883
- ${MOSQUITTO_MQTTS_PORT}:8883
environment:
- TZ=${TZ}
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks:
app-nw:
aliases:
- mqtt
influxdb:
image: influxdb:${INFLUXDB_VERSION}
restart: always
volumes:
- "./data/influxdb/conf:/etc/influxdb2"
- data_influxdb:/var/lib/influxdb2
ports:
- ${INFLUXDB_HTTP_PORT}:8086
environment:
- DOCKER_INFLUXDB_INIT_MODE=${INFLUXDB_INIT_MODE}
- DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_INIT_USERNAME}
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_INIT_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=${INFLUXDB_INIT_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${INFLUXDB_INIT_BUCKET}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_INIT_ADMIN_TOKEN}
- INFLUXD_LOG_LEVEL=${INFLUXD_LOG_LEVEL}
- TZ=${TZ}
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks:
app-nw:
backend-nw:
aliases:
- db
postgres:
image: postgres:${POSTGRES_VERSION}
restart: always
volumes:
- data_postgres:/var/lib/postgresql/data/
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- TZ=${TZ}
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks:
backend-nw:
aliases:
- postgresdb
renderer:
# official image
image: grafana/grafana-image-renderer:latest
# inofficial ones working on Raspberry Pi's
#image: adejong/grafana-image-renderer-pi:1.0.8-beta2
#image: serhiymakarenko/grafanalabs-image-renderer:latest
#image: asksven/grafana-image-renderer:1
#image: hferreira/grafana-image-renderer:latest
restart: always
environment:
- ENABLE_METRICS=true
- TZ=${TZ}
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks:
- backend-nw
grafana:
image: grafana/grafana:${GRAFANA_VERSION}
depends_on:
- influxdb
- renderer
- postgres
restart: always
user: "0"
volumes:
- data_grafana:/var/lib/grafana
ports:
- ${GRAFANA_HTTP_PORT}:3000
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel,briangann-gauge-panel,natel-plotly-panel,grafana-simple-json-datasource
- GF_SERVER_ROOT_URL=${GRAFANA_SERVER_ROOT_URL}
- GF_SMTP_ENABLED=${GRAFANA_SMTP_ENABLED}
- GF_SMTP_HOST=${GRAFANA_SMTP_HOST}
- GF_SMTP_USER=${GRAFANA_SMTP_USER}
- GF_SMTP_PASSWORD=${GRAFANA_SMTP_PASSWORD}
- GF_SMTP_FROM_ADDRESS=${GRAFANA_SMTP_FROM_ADDRESS}
- GF_DATABASE_TYPE=postgres
- GF_DATABASE_HOST=postgresdb
- GF_DATABASE_NAME=${POSTGRES_DB}
- GF_DATABASE_USER=${POSTGRES_USER}
- GF_DATABASE_PASSWORD=${POSTGRES_PASSWORD}
- GF_DATABASE_SSL_MODE=disable
- GF_UNIFIED_ALERTING_SCREENSHOTS_CAPTURE=true
- GF_RENDERING_SERVER_URL=http://renderer:8081/render
- GF_RENDERING_CALLBACK_URL=http://grafana:3000/
- GF_LOG_FILTERS=rendering:debug
# for anonymous access to embedding graphs
#- GF_AUTH_ANONYMOUS_ENABLED=true
#- GF_SECURITY_ALLOW_EMBEDDING=true
- TZ=${TZ}
labels:
- "com.centurylinklabs.watchtower.enable=true"
networks:
- app-nw
- backend-nw
volumes:
data_openhab_userdata:
data_influxdb:
data_postgres:
data_grafana:
data_mosquitto_data:
data_mosquitto_log:
networks:
app-nw:
internal: false
driver: bridge
driver_opts:
com.docker.network.bridge.name: app-${PROJECT_NAME}
backend-nw:
internal: true
driver: bridge
driver_opts:
com.docker.network.bridge.name: be-${PROJECT_NAME}