forked from mcci-catena/docker-iot-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
188 lines (177 loc) · 6.2 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
##############################################################################
#
# Name: docker-compose.yml
#
# Function:
# Configure the docker-ttn-dashboard collection of docker containers.
#
# Copyright:
# This file copyright (c) 2017 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/[^$]*${\([^:-}]*\)[:-}][^$]*/\1\n/gp' docker-compose.yml | sort -u
#
# TTN_DASHBOARD_APACHE_FQDN
# The fully-qualified domain name to be served by Apache.
#
# 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_HOST_FQDN
# The FQDN of the smtp host to be used for sending mail.
# Defaults to localhost.
#
# 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_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.
#
# Also see apache/setup.sh, which uses some additional test variables when
# debugging.
#
version: '2.1'
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
build: node-red
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
influxdb:
restart: unless-stopped
#mod by xenek
image: arm32v7/influxdb
volumes:
- "${TTN_DASHBOARD_DATA}influxdb:/var/lib/influxdb"
environment:
INFLUXDB_INIT_PWD: "${TTN_DASHBOARD_INFLUXDB_ADMIN_PASSWORD:-!notset}"
PRE_CREATE_DB: "${TTN_DASHBOARD_INFLUXDB_INITIAL_DATABASE_NAME:-demo}"
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:-.}"
ports:
- "${TTN_DASHBOARD_PORT_POSTFIX:-25}:25"
grafana:
restart: unless-stopped
#mod by xenek
image: rycus86/grafana:armhf
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: ${TTN_DASHBOARD_GRAFANA_SMTP_HOST:-localhost}:25
GF_SMTP_FROM_ADDRESS: "[email protected]"
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}
# grafana opens ports on influxdb and postfix, so it needs to be able to talk to it.
links:
- influxdb
- postfix
### end of file ###