Two stage build to reduce image size and build improvements provided by @imrehg.

Add (optional) metering support for use with Prometheus.
This commit is contained in:
Jac Kersing
2018-02-12 18:32:11 +01:00
parent e40d71b4a8
commit 2922f63a85
8 changed files with 125 additions and 38 deletions

15
start.sh.metering Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# Start the node exporter
mkdir /mnt/ramdisk
mount -t tmpfs -o size=8m tmpfs /mnt/ramdisk
cd /mnt/ramdisk
/opt/ttn-gateway/run.py &
# WORKAROUND: Add symlink, as gwexporter otherwise currently don't seem to find this file
ln -s /mnt/ramdisk/loragwstat.json /opt/gwexporter/loragwstat.json
export PATH=$PATH:/opt/gwexporter/bin
node /opt/gwexporter/gwexporter.js &
cd /etc && ./node_exporter -web.listen-address ":81"