Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Created March 6, 2019 02:09
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 juanpabloaj/a3405c32dea11ad1400fbc8bef088da5 to your computer and use it in GitHub Desktop.
Save juanpabloaj/a3405c32dea11ad1400fbc8bef088da5 to your computer and use it in GitHub Desktop.
version: '3'
services:
traefik:
image: traefik # The official Traefik docker image
command: --api -c traefik.toml #--docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
#- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- ${PWD}/traefik.toml:/traefik.toml
consul-agent-1: &consul-agent
image: consul:latest
command: "agent -retry-join consul-server-bootstrap -client 0.0.0.0"
consul-agent-2:
<<: *consul-agent
consul-agent-3:
<<: *consul-agent
consul-server-1: &consul-server
<<: *consul-agent
command: "agent -server -retry-join consul-server-bootstrap -client 0.0.0.0"
consul-server-2:
<<: *consul-server
consul-server-bootstrap:
<<: *consul-agent
ports:
- "8400:8400"
- "8500:8500"
- "8600:8600"
- "8600:8600/udp"
command: "agent -server -bootstrap-expect 3 -ui -client 0.0.0.0"
influxdb:
image: influxdb:1.5.4-alpine
ports:
- "8086:8086"
environment:
- INFLUXDB_DB=telegraf
- INFLUXDB_USER=telegraf
- INFLUXDB_USER_PASSWORD=secretpassword
grafana:
image: grafana/grafana:4.4.1
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=supersecret
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=http://localhost
[consulCatalog]
# Consul server endpoint
#
# Required
#
endpoint = "consul-server-bootstrap:8500"
# Default domain used.
#
# Optional
#
#domain = "localhost"
# Expose Consul catalog services by default in traefik
#
# Optional
#
exposedByDefault = true
# Prefix for Consul catalog tags
#
# Optional
#
prefix = "traefik"
[metrics]
[metrics.prometheus]
# ...
# InfluxDB metrics exporter type
[metrics.influxdb]
# InfluxDB's address.
#
# Required
# Default: "localhost:8089"
#
address = "telegraf:secretpassword@influxdb:8086"
# InfluxDB's address protocol (udp or http)
#
# Required
# Default: "udp"
#
protocol = "http"
# InfluxDB push interval
#
# Optional
# Default: "10s"
#
pushinterval = "10s"
# InfluxDB database used when protocol is http
#
# Optional
# Default: ""
#
database = "telegraf"
# InfluxDB retention policy used when protocol is http
#
# Optional
# Default: ""
#
retentionpolicy = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment