-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
119 lines (114 loc) · 4.44 KB
/
docker-compose.yaml
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
version: '3'
services:
orchestrator:
image: slframework/orchestrator:${ORCHESTRATOR_VERSION:-latest} # pulls from https://hub.docker.com/repository/docker/slframework/orchestrator
volumes:
- ./conf/orchestrator/config.dft.json:/usr/src/app/config.dft.json:ro
- ./conf/orchestrator/key.json:/usr/src/app/key.json:ro
- ./provision/orchestrator/docker-entrypoint.sh:/usr/src/app/docker-entrypoint.sh:ro
environment:
- OCONF_PWD_FILE_CONTENTS=${MQTT_PWD}
- OCONF_MQTT_USERNAME="${MQTT_USER}" # config strings going into json config file must have double quotes
- OCONF_MQTT="${MQTT_SERVER}" # config strings going into json config file must have double quotes
- OCONF_MQTT_PORT=${MQTT_SERVER_PORT}
command: ./docker-entrypoint.sh
restart: unless-stopped # service will respawn unless we tell docker to stop it
dashboard:
build:
# NOTE: dashboard config is only reflected when container is built
context: dashboard
dockerfile: Dockerfile
args:
- DCONF_PUBSUBURL='wss:\/\/${MQTT_WEBHOST}\/mqtt\/' # must be a valid sed expression
- DCONF_PUBSUBUSERNAME='${MQTT_USER}'
- DCONF_PUBSUBPASSWORD='${MQTT_PWD}'
volumes:
- ./conf/nginx.conf.template:/etc/nginx/templates/default.conf.template
environment:
- CORS_DOMAIN_REGEX=.*
# escape var for $ in envsubst templates
- ESC=$$
ports:
- ${DASHBOARD_PORT:-8001}:80
depends_on:
- orchestrator
# - influxdb
restart: unless-stopped
influxdb:
image: influxdb:2.4-alpine
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=${DOCKER_INFLUXDB_INIT_USERNAME}
- DOCKER_INFLUXDB_INIT_PASSWORD=${DOCKER_INFLUXDB_INIT_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=${DOCKER_INFLUXDB_INIT_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${DOCKER_INFLUXDB_INIT_BUCKET}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}
#ports:
# - 18086:8086 # Initial setup, automate and remove later
volumes:
- influxdb_data:/var/lib/influxdb
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "2"
restart: unless-stopped
telegraf:
image: telegraf:1.24-alpine
environment:
- DOCKER_INFLUXDB_INIT_ORG=${DOCKER_INFLUXDB_INIT_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${DOCKER_INFLUXDB_INIT_BUCKET}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}
# MQTT_SERVER not working; custom docker-entrypoint.sh will replace MQTT_SERVER for value of
#- MQTT_SERVER="tcp://${MQTT_SERVER}:${MQTT_SERVER_PORT}" # non ssl connection
#- MQTT_SERVER="ssl://${MQTT_SERVER}:${MQTT_SERVER_PORT}" # ssl connection
- TCONF_MQTT_SERVER="ssl://${MQTT_SERVER}:${MQTT_SERVER_PORT}" # ssl connection
- MQTT_TOPIC=${MQTT_TOPIC}
- MQTT_CLIENTID=${MQTT_CLIENTID:-influx_metric_logger}
- MQTT_USER=${MQTT_USER}
- MQTT_PWD=${MQTT_PWD}
depends_on:
- influxdb
volumes:
- ./provision/telegraf/docker-entrypoint.sh:/docker-entrypoint.sh:ro
- ./conf/telegraf/telegraf.dft.conf:/telegraf.dft.conf:ro
links:
- influxdb
command: /docker-entrypoint.sh
restart: unless-stopped
grafana:
image: grafana/grafana-oss:9.1.6 # alpine is default
depends_on:
- influxdb
user: "472"
environment:
- TZ=${TZ}
- GF_INSTALL_PLUGINS=${GF_INSTALL_PLUGINS}
- GF_SERVER_ROOT_URL=${GF_SERVER_ROOT_URL}
- GF_SERVER_SERVE_FROM_SUB_PATH=true
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}
- GF_SECURITY_ALLOW_EMBEDDING=true
- GF_AUTH_ANONYMOUS_ENABLED=true # TODO: provision viewer user w/ reverse proxy + auth headers
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org.
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
- GF_AUTH_ANONYMOUS_HIDE_VERSION=true
- GF_USERS_DEFAULT_THEME=light
volumes:
- grafana_data:/var/lib/grafana
- ./provision/grafana/provisioning/:/etc/grafana/provisioning/
- ./provision/grafana/dashboards/:/var/lib/grafana/dashboards/
links:
- influxdb
#ports:
# - 13000:3000
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "2"
restart: unless-stopped
volumes:
influxdb_data:
grafana_data: