Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3"
- services:
- influxdb:
- container_name: influxdb
- image: influxdb:1.8.3
- # this needs to be accessible from outside (other telegrafs)
- # and from telegraf (inside)
- network_mode: "host"
- ports:
- - "8086:8086"
- volumes:
- - /home/student/projects/tig/data/influxdb:/var/lib/influxdb
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/influxdb:/etc/influxdb/
- restart: always
- telegraf:
- container_name: telegraf
- image: telegraf:1.17.1
- depends_on:
- - influxdb
- network_mode: "host"
- volumes:
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf
- - /var/run/docker.sock:/var/run/docker.sock
- restart: always
- grafana:
- container_name: grafana
- image: grafana/grafana:7.3.7
- depends_on:
- - influxdb
- network_mode: "host"
- user: "0"
- ports:
- - "3000:3000"
- volumes:
- - /home/student/projects/tig/data/grafana:/var/lib/grafana
- - /home/student/projects/tig/log/grafana:/var/log/grafana
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/grafana/grafana.ini:/etc/grafana/grafana.ini
- restart: always
- mqtt:
- container_name: mqtt
- image: eclipse-mosquitto:latest
- network_mode: "host"
- user: "0"
- ports:
- - "1883:1883"
- - "9001:9001"
- volumes:
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/mqtt/:/mosquitto/config/
- - /home/student/projects/tig/data/mqtt/:/mosquitto/data/
- - /home/student/projects/tig/log/mqtt/:/mosquitto/log/
- restart: always
- -------------------------
- accessible from outside (another machine)
- from the same machine:
- I can get the grafana index.html:
- # wget localhost:3000
- Connecting to localhost:3000 (127.0.0.1:3000)
- saving to 'index.html'
- index.html 100% |**********************************************************************************************************************************************| 27956 0:00:00 ETA
- 'index.html' saved
- I can access index.html from another container:
- # docker exec -ti influxdb /bin/sh
- # wget localhost:3000
- --2021-01-30 12:01:33-- http://localhost:3000/
- Resolving localhost (localhost)... ::1, 127.0.0.1
- Connecting to localhost (localhost)|::1|:3000... connected.
- HTTP request sent, awaiting response... 302 Found
- Location: /login [following]
- --2021-01-30 12:01:33-- http://localhost:3000/login
- Reusing existing connection to [localhost]:3000.
- HTTP request sent, awaiting response... 200 OK
- Length: unspecified [text/html]
- Saving to: 'index.html'
- index.html [ <=> ] 27.30K --.-KB/s in 0.001s
- 2021-01-30 12:01:33 (33.4 MB/s) - 'index.html' saved [27956]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement