forked from mcci-catena/docker-iot-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
236 lines (224 loc) · 7.73 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
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
235
236
##############################################################################
#
# Name: docker-compose.yml
#
# Function:
# Configure the docker-ttn-dashboard collection of docker containers.
#
# Copyright:
# This file copyright (c) 2017-2019 by
#
# MCCI Corporation
# 3520 Krums Corners Road
# Ithaca, NY 14850
#
# Distributed under the terms of the license file shipped with this
# collection.
#
# Author:
# Terry Moore, MCCI Corporation
# Based on work by Johan Stocking, The Things Network
#
##############################################################################
#
# Note: if you are running this manually, you must set a number of variables,
# not least TTN_DASHBOARD_DATA, which must be the path to the top data directory
# for these apps. If you use dashboard-ctl, this will be done for you.
#
# To get a list of all variables used in this file, use the following command:
# sed -n -e 's/#.*$//' -e 's/[^$]*${\([^-:}]*\)[-:}][^$]*/\1/p' docker-compose.yml | LC_ALL=C sort -u
#
# To get a list of undocumented variables, use the following command,
# then look in the left hand column:
#
# comm <(sed -n -e 's/#.*$//' -e 's/[^$]*${\([^-:}]*\)[-:}][^$]*/\1/p' docker-compose.yml | LC_ALL=C sort -u) <(sed -n -e '/^# TTN_[A-Z_0-9]*$/s/^# //p' docker-compose.yml | LC_ALL=C sort -u )
#
#+++
# TTN_DASHBOARD_APACHE_FQDN
# The fully-qualified domain name to be served by Apache.
#
# TTN_DASHBOARD_AWS_ACCESS_KEY_ID
# The access key for AWS for backups.
#
# TTN_DASHBOARD_AWS_DEFAULT_REGION
# The AWS default region.
#
# TTN_DASHBOARD_AWS_S3_BUCKET_INFLUXDB
# The S3 bucket to use for uploading the influxdb backup data.
#
# TTN_DASHBOARD_AWS_SECRET_ACCESS_KEY
# The AWS API secret key for backing up influxdb data.
#
# TTN_DASHBOARD_CERTBOT_EMAIL
# The email address to be used for registering with Let's Encrypt.
#
# TTN_DASHBOARD_CERTBOT_FQDN
# The domain(s) to be used by certbot when registering with Let's Encrypt.
#
# TTN_DASHBOARD_DATA
# The path to the data directory. This must end with a '/', and must either
# be absolute or must begin with './'. (If not, you'll get parse errors.)
#
# TTN_DASHBOARD_GRAFANA_ADMIN_PASSWORD
# The password to be used for the admin user on first login. This is ignored
# after the Grafana database has been built.
#
# TTN_DASHBOARD_GRAFANA_PROJECT_NAME
# The project name to be used for the emails from the administrator.
#
# TTN_DASHBOARD_GRAFANA_LOG_MODE
# Set the grafana log mode.
#
# TTN_DASHBOARD_GRAFANA_LOG_LEVEL
# Set the grafana log level (e.g. debug)
#
# TTN_DASHBOARD_GRAFANA_SMTP_ENABLED
# Set to true to enable SMTP.
#
# TTN_DASHBOARD_GRAFANA_SMTP_SKIP_VERIFY
# Set to true to disable SSL verification.
# Defaults to false.
#
# TTN_DASHBOARD_GRAFANA_INSTALL_PLUGINS
# A list of grafana plugins to install.
#
# TTN_DASHBOARD_GRAFANA_SMTP_FROM_ADDRESS
# The "from" address for Grafana emails.
#
# TTN_DASHBOARD_GRAFANA_USERS_ALLOW_SIGN_UP
# Set to true to allow users to sign up.
#
# TTN_DASHBOARD_INFLUXDB_ADMIN_PASSWORD
# The password to be used for the admin user by influxdb. Again, this is
# ignored after the influxdb database has been built.
#
# TTN_DASHBOARD_INFLUXDB_INITIAL_DATABASE_NAME
# The inital database to be created on first launch of influxdb. Ignored
# after influxdb has been launched.
#
# TTN_DASHBOARD_MAIL_DOMAIN
# the postfix mail domain.
#
# TTN_DASHBOARD_MAIL_HOST_NAME
# the external FQDN for the mail host.
#
# TTN_DASHBOARD_MAIL_RELAY_IP
# the mail relay machine, assuming that the real mailer is upstream from us.
#
# TTN_DASHBOARD_NODERED_INSTALL_PLUGINS
# A list of additional modules to be intalled.
#
# TTN_DASHBOARD_PORT_HTTP
# The port to listen to for HTTP. Primarily for test purposes. Defaults to
# 80.
#
# TTN_DASHBOARD_PORT_HTTPS
# The port to listen to for HTTPS. Primarily for test purposes. Defaults to
# 443.
#
# TTN_DASHBOARD_TIMEZONE
# The timezone to use. Defaults to GMT.
#---
# Also see apache/setup.sh, which uses some additional test variables when
# debugging.
#
version: '3.7'
services:
# the apache server connects us to the outside world
apache:
environment:
CERTBOT_DOMAINS: "${TTN_DASHBOARD_CERTBOT_FQDN:-.}"
CERTBOT_EMAIL: "${TTN_DASHBOARD_CERTBOT_EMAIL:-.}"
APACHE_FQDN: "${TTN_DASHBOARD_APACHE_FQDN:-.}"
restart: unless-stopped
build: apache
ports:
- "${TTN_DASHBOARD_PORT_HTTP:-80}:80"
- "${TTN_DASHBOARD_PORT_HTTPS:-443}:443"
volumes:
- "${TTN_DASHBOARD_DATA}docker-apache2/htdocs:/usr/local/apache2/htdocs"
- "${TTN_DASHBOARD_DATA}docker-apache2/letsencrypt:/etc/letsencrypt"
- "${TTN_DASHBOARD_DATA}docker-apache2/authdata:/etc/apache2/authdata"
#
# apache proxies for all of the below, so it needs to have links to them.
# Examine apache/proxy-*.conf to see how the links are set up. Also bear
# in mind that the individual servers (e.g. grafana) may need to be
# informed about the nature of the redirections.
#
links:
- grafana
- node-red
- influxdb
node-red:
restart: unless-stopped
user: "root"
volumes:
- "${TTN_DASHBOARD_DATA}node-red:/data"
# nodered opens ports on influxdb so it needs to be able to talk to it.
links:
- influxdb
- postfix
environment:
TZ: "${TTN_DASHBOARD_TIMEZONE:-GMT}"
build:
context: ./node-red
args:
NODERED_INSTALL_PLUGINS: "${TTN_DASHBOARD_NODERED_INSTALL_PLUGINS:-}"
influxdb:
restart: unless-stopped
image: influxdb:latest
volumes:
- "${TTN_DASHBOARD_DATA}influxdb:/var/lib/influxdb"
environment:
INFLUXDB_DB: "${TTN_DASHBOARD_INFLUXDB_INITIAL_DATABASE_NAME:-demo}"
INFLUXDB_INIT_PWD: "${TTN_DASHBOARD_INFLUXDB_ADMIN_PASSWORD:-!notset}"
INFLUXDB_BIND_ADDRESS: "influxdb:8088"
influxdb-backup:
restart: unless-stopped
build: influxdb-backup
volumes:
# Dircectory for database backup inside "./data"
- "${TTN_DASHBOARD_DATA}influx-backup:/var/lib/influxdb-backup"
# Connecting influxdb data directory to extra instances
- "${TTN_DASHBOARD_DATA}influxdb:/var/lib/influxdb"
environment:
INFLUX_HOST: influxdb
S3_BUCKET_INFLUXDB: "${TTN_DASHBOARD_AWS_S3_BUCKET_INFLUXDB:-.}"
AWS_ACCESS_KEY_ID: "${TTN_DASHBOARD_AWS_ACCESS_KEY_ID:-.}"
AWS_SECRET_ACCESS_KEY: "${TTN_DASHBOARD_AWS_SECRET_ACCESS_KEY:-.}"
AWS_DEFAULT_REGION: "${TTN_DASHBOARD_AWS_DEFAULT_REGION:-.}"
links:
- influxdb
postfix:
restart: unless-stopped
build:
context: ./postfix
dockerfile: Dockerfile
args:
relay_ip: "${TTN_DASHBOARD_MAIL_RELAY_IP:-}"
host_name: "${TTN_DASHBOARD_MAIL_HOST_NAME:-.}"
domain: "${TTN_DASHBOARD_MAIL_DOMAIN:-.}"
grafana:
restart: unless-stopped
image: grafana/grafana:latest
user: "root"
volumes:
- "${TTN_DASHBOARD_DATA}grafana:/var/lib/grafana"
environment:
GF_SECURITY_ADMIN_PASSWORD: "${TTN_DASHBOARD_GRAFANA_ADMIN_PASSWORD:-!notset}"
GF_SERVER_DOMAIN: "${TTN_DASHBOARD_APACHE_FQDN}"
GF_SERVER_ROOT_URL: "https://%(domain)s/grafana/"
GF_SMTP_ENABLED: "${TTN_DASHBOARD_GRAFANA_SMTP_ENABLED:-false}"
GF_SMTP_SKIP_VERIFY: "${TTN_DASHBOARD_GRAFANA_SMTP_SKIP_VERIFY:-false}"
GF_SMTP_HOST: "postfix:25"
GF_SMTP_FROM_ADDRESS: "${TTN_DASHBOARD_GRAFANA_SMTP_FROM_ADDRESS:-grafana@localhost}"
GF_SMTP_FROM_NAME: "${TTN_DASHBOARD_GRAFANA_PROJECT_NAME:-Default} grafana admin"
GF_LOG_MODE: "${TTN_DASHBOARD_GRAFANA_LOG_MODE:-console,file}"
GF_LOG_LEVEL: "${TTN_DASHBOARD_GRAFANA_LOG_LEVEL:-info}"
GF_INSTALL_PLUGINS: "${TTN_DASHBOARD_GRAFANA_INSTALL_PLUGINS:-}"
GF_USERS_ALLOW_SIGN_UP: "${TTN_DASHBOARD_GRAFANA_USERS_ALLOW_SIGN_UP:-false}"
# grafana opens ports on influxdb and postfix, so it needs to be able to talk to it.
links:
- influxdb
- postfix
### end of file ###