forked from jpmeijers/ttn-resin-gateway-rpi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-prometheus.yml
68 lines (66 loc) · 1.76 KB
/
docker-compose-prometheus.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
# Docker-compose file for TTN gateway
# Includes the Prometheus service
# Version 2.1 for balena compatibility
version: '2.1'
services:
# The gateway itself
gateway:
build:
context: gateway
args:
GW_MACHINE_NAME:
image: amedee/ttn-gateway
privileged: true
network_mode: host
restart: always
environment:
SERVER_TTN_CLUSTER_ID: "${SERVER_TTN_CLUSTER_ID:-eu1}"
GW_KEY: "${GW_KEY:?Gateway Key is mandatory}"
GW_ID: "${GW_ID:?Gateway Id is mandatory}"
GW_EUI: "${GW_EUI}"
GW_LOGGER: "${GW_LOGGER:-false}"
GW_PRINT_STATS: "${GW_PRINT_STATS:-true}"
GW_SPI_SPEED: "${GW_SPI_SPEED}"
GW_GPS: "${GW_GPS:-false}"
GW_RESET_PIN: "${GW_RESET_PIN:-22}"
# GW_STAT_FILE is mandatory for reporting metrics
GW_STAT_FILE: "true"
devices:
- "/dev/mem:/dev/mem"
volumes:
- var_ttn_vol:/var/ttn
# Prometheus exporter
prom-exporter:
build:
context: prom-exporter
args:
GW_MACHINE_NAME:
image: amedee/ttn-prom-exporter
privileged: true
restart: always
# "link" is not supported in balena, we bind to localhost
ports:
- "127.0.0.1:9100:9100"
# TTN exporter
exporter:
build:
context: exporter
args:
GW_MACHINE_NAME:
image: amedee/ttn-exporter
privileged: true
# Exporter needs to access localhost to call prom-exporter
network_mode: host
restart: always
volumes:
- var_ttn_vol:/var/ttn
# balenaCloud users
# Insert the fan service from the docker-compose-fan.yml file here
# to control the fan connected to the Coredump backplane
# (Plain docker users can use an override file)
volumes:
var_ttn_vol:
driver: local
driver_opts:
type: tmpfs
device: tmpfs