Merge branch 'master' of git.neur0tx.site:Neur0toxine/docker-logs-grafana-clickhouse
This commit is contained in:
commit
f3382f71f3
4
.env
Normal file
4
.env
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
CLICKHOUSE_USER=default
|
||||||
|
CLICKHOUSE_PASSWORD=default
|
||||||
|
CLICKHOUSE_DB=default
|
||||||
|
CLICKHOUSE_PORT=8123
|
16
Makefile
16
Makefile
@ -1,12 +1,24 @@
|
|||||||
|
include .env
|
||||||
SHELL = /bin/bash -o pipefail
|
SHELL = /bin/bash -o pipefail
|
||||||
|
|
||||||
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
MIGRATIONS_DIR=$(SRC_DIR)/files/migrations
|
MIGRATIONS_DIR=$(ROOT_DIR)/files/migrations
|
||||||
|
|
||||||
|
all: migrator migrate up
|
||||||
|
|
||||||
|
migrator:
|
||||||
|
@docker buildx build --tag neur0toxine/clickhouse-migrations:latest -f $(ROOT_DIR)/files/Dockerfile.migrator $(ROOT_DIR)/files
|
||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
@docker-compose up -d
|
@docker-compose up -d
|
||||||
@docker run -v $(MIGRATIONS_DIR):/migrations --network host migrate/migrate -path=/migrations/ -database "clickhouse://localhost:8123?username=default&password=default&database=default" up all
|
@docker run -v $(MIGRATIONS_DIR):/migrations --network host neur0toxine/clickhouse-migrations:latest migrate --host=http://localhost:$(CLICKHOUSE_PORT) --user=$(CLICKHOUSE_USER) --password=$(CLICKHOUSE_PASSWORD) --db=default --migrations-home=/migrations
|
||||||
@docker-compose stop
|
@docker-compose stop
|
||||||
|
|
||||||
up:
|
up:
|
||||||
@docker-compose up
|
@docker-compose up
|
||||||
|
|
||||||
|
stop:
|
||||||
|
@docker-compose stop
|
||||||
|
|
||||||
|
down:
|
||||||
|
@docker-compose down -v
|
||||||
|
1063
dashboards/Logs + Structured via Query (zaplog).json
Normal file
1063
dashboards/Logs + Structured via Query (zaplog).json
Normal file
File diff suppressed because it is too large
Load Diff
3
files/Dockerfile.migrator
Normal file
3
files/Dockerfile.migrator
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM node:lts-alpine
|
||||||
|
RUN npm install --global clickhouse-migrations && npm cache clean --force
|
||||||
|
ENTRYPOINT ["/usr/local/bin/clickhouse-migrations"]
|
@ -1 +0,0 @@
|
|||||||
DROP TABLE log_docker_raw;
|
|
@ -40,4 +40,4 @@ sinks:
|
|||||||
user: default
|
user: default
|
||||||
password: default
|
password: default
|
||||||
database: default
|
database: default
|
||||||
table: log_docker_raw
|
table: log_docker_raw
|
Loading…
Reference in New Issue
Block a user