Files
butler-sos/docs/docker-compose/docker-compose_fullstack_influxdb_v3.yml
2025-12-12 17:24:12 +01:00

84 lines
3.2 KiB
YAML

# docker-compose_fullstack_influxdb_v3.yml
# InfluxDB v3.x (Core) - using the InfluxDB 3.x Community Edition
# Inspiration from https://github.com/InfluxCommunity/TIG-Stack-using-InfluxDB-3/blob/main/docker-compose.yml
services:
butler-sos:
image: ptarmiganlabs/butler-sos:latest
container_name: butler-sos
restart: unless-stopped
ports:
- "9997:9997" # UDP user events
- "9996:9996" # UDP log events
- "9842:9842" # Prometheus metrics
- "3100:3100" # Config file visualization
volumes:
# Make config file and log files accessible outside of container
- "./config:/nodeapp/config"
- "./log:/nodeapp/log"
command: ["node", "src/butler-sos.js", "-c", "/nodeapp/config/${BUTLER_SOS_CONFIG_FILE}"]
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "5m"
depends_on:
# Or switch to influxdb3-enterprise as needed
- influxdb-v3-core
networks:
- senseops
influxdb-v3-core:
# Note: InfluxDB v3 Core is available as influxdb3 image
# For production use, consider InfluxDB Cloud or Enterprise
image: influxdb:3-core
container_name: influxdb-v3-core
restart: unless-stopped
ports:
- ${INFLUXDB_HTTP_PORT}:8181
command:
- influxdb3
- serve
- --node-id=${INFLUXDB_NODE_ID}
- --object-store=file
- --data-dir=/var/lib/influxdb3
volumes:
- ./influxdb/data:/var/lib/influxdb3 # Mount for influxdb data directory
- ./influxdb/config/:/etc/influxdb3/ # Mount for influxdb configuration
# environment:
# InfluxDB v3 setup - uses similar setup to v2 but different internal architecture
# - "DOCKER_INFLUXDB_INIT_MODE=setup"
# - "DOCKER_INFLUXDB_INIT_USERNAME=admin"
# - "DOCKER_INFLUXDB_INIT_PASSWORD=butlersos123"
# - "DOCKER_INFLUXDB_INIT_ORG=butler-sos"
# - "DOCKER_INFLUXDB_INIT_BUCKET=butler-sos"
# - "DOCKER_INFLUXDB_INIT_DATABASE=butler-sos" # v3 uses database concept
# - "DOCKER_INFLUXDB_INIT_RETENTION=10d"
# - "DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=butlersos-token"
healthcheck:
test: ["CMD-SHELL", "curl -f -H 'Authorization: Bearer ${INFLUXDB_TOKEN}' http://localhost:8181/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
networks:
- senseops
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
ports:
- "${GRAFANA_PORT}:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
volumes:
- ./grafana/data:/var/lib/grafana
depends_on:
# Or switch to influxdb3-enterprise as needed
- influxdb-v3-core
networks:
- senseops
networks:
senseops:
driver: bridge