-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 1.05 KB
/
Makefile
File metadata and controls
38 lines (29 loc) · 1.05 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
# Makefile for managing local Flink + Kafka environment
DOCKER_COMPOSE = docker compose
SERVICES_CORE = kafka kafka-init kafka-ui jobmanager taskmanager1 taskmanager2 prometheus grafana
PRODUCER = kafka-producer
.PHONY: up down logs producer restart clean
## Build all Docker images
build:
$(DOCKER_COMPOSE) build
## Start the core stack (Kafka + Flink)
up:
$(DOCKER_COMPOSE) up -d $(SERVICES_CORE)
@echo "\nCore stack started. Flink UI: http://localhost:8081 | Kafka UI: http://localhost:9000 | Grafana UI: http://localhost:3000 | Prometheus UI: http://localhost:9090"
## Start the Kafka producer (after stack is ready)
producer:
$(DOCKER_COMPOSE) up -d $(PRODUCER)
@echo "\nKafka producer started."
## View logs for all services
logs:
$(DOCKER_COMPOSE) logs -f --tail=50
## Stop and remove all containers
down:
$(DOCKER_COMPOSE) down
@echo "\nAll containers stopped and removed."
## Restart the core stack
restart: down up
## Remove all containers, networks, and volumes
clean:
$(DOCKER_COMPOSE) down -v --remove-orphans
@echo "\nEnvironment fully cleaned."