ok, I did forgot to remove those lines, I did think that you are trying to run grafana alone.
here is my complet TIG compose file
---
version: '3'
networks:
default:
name: kontainers
external: true
services:
influxdb:
image: influxdb:2.7.1
container_name: influxdb
user: "1000:984"
env_file:
- env
volumes:
- /docker_volumes/tig/influxdb/:/var/lib/influxdb2
# ports:
# - "8086:8086"
restart: unless-stopped
telegraf:
image: telegraf:1.27.0
container_name: telegraf
user: "1000:984"
env_file:
- env
volumes:
- /docker_volumes/tig/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
depends_on:
- influxdb
restart: unless-stopped
grafana:
image: grafana/grafana-oss
container_name: grafana
user: "1000:984"
volumes:
- /docker_volumes/tig/grafana:/var/lib/grafana
# ports:
# - 3000:3000
depends_on:
- influxdb
restart: unless-stopped
all services are contented to “kontainers” network which I am using for all containers, also swag container is there. I did configure swag so I can access influx and grafana over subdomain.
here is env file
# Automated setup will not run if an existing boltdb file is found at the configured path.
# This behavior allows for the InfluxDB container to reboot post-setup without encountering "DB is already set up" errors.
#
DOCKER_INFLUXDB_INIT_MODE=setup
# Primary InfluxDB admin/superuser credentials
#
DOCKER_INFLUXDB_INIT_USERNAME=xxxxxx
DOCKER_INFLUXDB_INIT_PASSWORD=xxxxxxx
# generated by openssl rand -hex 32
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=xxxxxxxxxx
# Primary InfluxDB organization & bucket definitions
#
DOCKER_INFLUXDB_INIT_ORG=xxxxx
DOCKER_INFLUXDB_INIT_BUCKET=xxxxx
# Primary InfluxDB bucket retention period
# NOTE: Valid units are nanoseconds (ns), microseconds(us), milliseconds (ms)
# seconds (s), minutes (m), hours (h), days (d), and weeks (w).
#
DOCKER_INFLUXDB_INIT_RETENTION=2w
# InfluxDB hostname; same as docker container name
#
DOCKER_INFLUXDB_INIT_HOST=influxdb
steps to start container
#1 create volume directiories:
mkdir -p /docker_volumes/tig/influxdb
mkdir -p /docker_volumes/tig/telegraf
mkdir -p /docker_volumes/tig/grafana
#2.1 create telegraf.conf
docker run --rm telegraf telegraf config > telegraf.conf
#2.2 edit telegraf.conf and choose what you need
#2.3 cp telegraf.conf /docker_volumes/tig/telegraf/
#3 start