Skip to content

Instantly share code, notes, and snippets.

@soelu
Forked from zshamrock/docker-compose.yml
Last active February 20, 2017 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soelu/3156e100857c96b49281dc8f9f202bb2 to your computer and use it in GitHub Desktop.
Save soelu/3156e100857c96b49281dc8f9f202bb2 to your computer and use it in GitHub Desktop.
TICK services docker compose
version: '2'
networks:
# create a network to share between TICK services, so they can connect to each other by specifying influxdb network name
influxdb:
services:
telegraf:
image: telegraf:1.2.1
container_name: telegraf1.2.1
# use network_mode: "service:influxdb" to be able to use http://localhost:8086 to connect influxdb output plugin
# an alternative option would be to specify
# networks:
# - influxdb
# which puts both Telegraf and InfluxDB on the same network,
# but does require to update conf/telegraf.conf: set urls of [[output.influxdb]] into http://influxdb:8086
network_mode: "service:influxdb"
volumes:
- $PWD/conf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
depends_on:
- influxdb
influxdb:
image: influxdb:1.2
container_name: influxdb1.2
ports:
# Administrator interface port
- "8083:8083"
# HTTP API port
- "8086:8086"
volumes:
- $PWD/data/influxdb:/var/lib/influxdb
- $PWD/conf/influxdb.conf:/etc/influxdb/influxdb.conf:ro
environment:
# to enable admin interface, or otherwise from influxdb.conf [admin]/enable
# although it is planned to be removed from the product,
# see for the details https://github.com/influxdata/influxdata-docker/issues/48
- INFLUXDB_ADMIN_ENABLED=true
networks:
- influxdb
command: [-config, /etc/influxdb/influxdb.conf]
chronograf:
image: chronograf:1.0.0-rc1
container_name: chronograf1.0.0-rc1
ports:
- "10000:10000"
volumes:
- $PWD/conf/chronograf.conf:/etc/chronograf/chronograf.conf:ro
networks:
- influxdb
depends_on:
- telegraf
- influxdb
- kapacitor
kapacitor:
image: kapacitor:1.2
container_name: kapacitor1.2
ports:
- "9092:9092"
volumes:
- $PWD/data/kapacitor:/var/lib/kapacitor
- $PWD/conf/kapacitor.conf:/etc/kapacitor/kapacitor.conf:ro
environment:
- KAPACITOR_INFLUXDB_0_URLS_0=http://influxdb:8086
# not sure why it is necessary to provide a hostname,
# but it looks like Kapacitor subscribes to the InfluxDB by connecting to KAPACITOR_INFLUXDB_0_URLS_0
# and probably sends its own hostname on the way, so InfluxDB can communicate back
# at least this line below is from the influxdb logs:
# influxdb1.1.1 | [query] 2016/12/15 10:19:54 CREATE SUBSCRIPTION "kapacitor-7a54eb73-75f6-488b-9190-830f8846a1c2" ON telegraf.autogen DESTINATIONS ANY 'http://kapacitor:9092'
hostname: kapacitor
networks:
- influxdb
depends_on:
- telegraf
- influxdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment