Skip to content

Commit

Permalink
Add in sample docker-compose for clickhouse (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzealey authored Apr 22, 2023
1 parent 2915bd1 commit 028ee0b
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions clickhouse/docker-compose-clickhouse-grafana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# A sample docker-compose environment containing Grafana, CH and DNSMonster.
# DNSMonster listens for DNSTap traffic on port 5555, Grafana is exposed on
# port 3000. Data is stored locally under ./clickhouse-data and ./grafana/data
#
# Prior to spinning up you should run:
# mkdir -p grafana/data/
# sudo chown 472.472 grafana/data/
#
# You can set dnsdist to send traffic over DNSTap by adding the following to
# the config file:
#
# -- Get hostname of server
# local f = io.popen ("/bin/hostname")
# local hostname = f:read("*a") or "dnsdist"
# f:close()
# hostname = string.gsub(hostname, "\n$", "")
#
# -- Set up dnstap logging over TCP
# logger = newFrameStreamTcpLogger("<dnsmonster server>:5555")
# addAction(AllRule(), DnstapLogAction(hostname, logger))
# addResponseAction(AllRule(), DnstapLogResponseAction(hostname, logger))
# addCacheHitResponseAction(AllRule(), DnstapLogResponseAction(hostname, logger))

version: "3.9"

services:
# Access like:
# docker-compose exec clickhouse clickhouse client -mn
clickhouse:
image: clickhouse/clickhouse-server:23.3
restart: unless-stopped
networks:
- overlay
volumes:
- "./clickhouse-data:/var/lib/clickhouse"
# For first-time provisioning
- "./tables.sql:/docker-entrypoint-initdb.d/tables.sql:ro"

grafana:
image: grafana/grafana:9.4.7
restart: unless-stopped
networks:
- overlay
environment:
- GF_INSTALL_PLUGINS=vertamedia-clickhouse-datasource
volumes:
#- "./grafana/config:/etc/grafana"
- "./grafana/data:/var/lib/grafana"
ports:
- 3000:3000

dnsmonster:
image: ghcr.io/mosajjal/dnsmonster:latest
restart: unless-stopped
networks:
- overlay
depends_on:
- clickhouse
ports:
- 5555:5555
environment:
- PUID=1000
- PGID=1000
command:
- "--dnstapSocket=tcp://0.0.0.0:5555"
# See config at https://dnsmonster.dev/docs/outputs/clickhouse/
- "--clickhouseOutputType=1"
- "--clickhouseAddress=clickhouse:9000"
- "--clickhouseDelay=1s"
- "--clickhouseBatchSize=100000"
#- "--stdoutOutputType=1"
#- "--stdoutOutputFormat=json"

networks:
overlay:

0 comments on commit 028ee0b

Please sign in to comment.