influx setup

This commit is contained in:
Niko Abeler 2023-02-04 23:12:04 +01:00
parent e9d6cf2fa7
commit 275e41cbc0
4 changed files with 36 additions and 1 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
influx-data/
tokens/*.txt
passwords*

View File

@ -12,4 +12,27 @@ services:
volumes:
- ./rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
- ./rabbitmq/definitions.json:/etc/rabbitmq/definitions.json:ro
- ./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:rw
- ./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:rw
influx:
hostname: influx
image: influxdb:2.6
ports:
- "24005:8086"
volumes:
- ./influx-data:/var/lib/influxdb2:rw
- ./influx/scripts:/docker-entrypoint-initdb.d
- ./tokens:/tokens:rw
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=admin
- DOCKER_INFLUXDB_INIT_PASSWORD=admin1234
- DOCKER_INFLUXDB_INIT_ORG=home
- DOCKER_INFLUXDB_INIT_BUCKET=sensor
gatherer:
hostname: gatherer
volumes:
- ./tokens:/tokens:ro
depends_on:
- rabbitmq
- influx

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
echo "Creating tokens for ${DOCKER_INFLUXDB_INIT_ORG} organization"
influx auth create \
--org ${DOCKER_INFLUXDB_INIT_ORG} \
--read-buckets \
--write-buckets | tail -1 | awk '{print $2}' > /tokens/read_write.txt
echo "Read/Write token created"

0
tokens/.gitkeep Normal file
View File