-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (47 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
67 lines (47 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Default PROJECT, if not given by another Makefile.
ifndef PROJECT
PROJECT=grafana-stack
endif
# Override the default dependency list — this is a Docker Compose project, not Go.
DEPENDENCIES := docker
LOKI_PLUGIN_ALIAS := loki
LOKI_PLUGIN_IMAGE := grafana/loki-docker-driver:3.0.0
# Targets.
install-loki-plugin: ## Installs the Loki Docker logging plugin (required once per machine).
install-loki-plugin:
@if ! docker plugin ls | grep -q "$(LOKI_PLUGIN_ALIAS)"; then \
echo "Installing Loki Docker logging plugin..."; \
docker plugin install $(LOKI_PLUGIN_IMAGE) --alias $(LOKI_PLUGIN_ALIAS) --grant-all-permissions; \
else \
echo "Loki Docker logging plugin already installed."; \
fi
PHONY += install-loki-plugin
---: ## ---
run: ## ** Runs ALL docker-compose services locally (installs Loki plugin if needed).
run: install-loki-plugin
docker compose up \
--build \
--force-recreate \
--remove-orphans
PHONY += run
stop: ## Stops and removes ALL docker-compose services.
stop:
docker compose down
PHONY += stop
restart: ## Restarts ALL docker-compose services.
restart: stop run
PHONY += restart
logs: ## Tails logs from ALL docker-compose services.
logs:
docker compose logs -f
PHONY += logs
status: ## Shows the status of all docker-compose services.
status:
docker compose ps
PHONY += status
---: ## ---
# Includes the common Makefile.
# NOTE: this recursively goes back and finds the `.git` directory and assumes
# this is the root of the project. This could have issues when this assumtion
# is incorrect.
include $(shell while [[ ! -d .git ]]; do cd ..; done; pwd)/Makefile.common.mk