-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (39 loc) · 1.33 KB
/
Copy pathMakefile
File metadata and controls
49 lines (39 loc) · 1.33 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
.PHONY: start stop restart logs status shell clean setup update
COMPOSE = docker compose
CONTAINER = freeipa-server
## First-time setup: generate .env and docker-compose.yml
setup:
@bash setup.sh
## Start the container (installs IPA on first run, ~5 min)
start:
$(COMPOSE) up -d
@echo "Follow progress with: make logs"
## Stop the container gracefully
stop:
$(COMPOSE) stop
## Restart the container
restart:
$(COMPOSE) restart
## Follow container logs (Ctrl-C to exit)
logs:
$(COMPOSE) logs -f freeipa
## Show container status and IPA service health
status:
@$(COMPOSE) ps
@echo
@docker exec $(CONTAINER) ipactl status 2>/dev/null || echo "(IPA not running or not installed)"
## Open a shell inside the running container
shell:
docker exec -it $(CONTAINER) /bin/bash
## Pull latest image and recreate container (preserves data)
update:
$(COMPOSE) pull
$(COMPOSE) up -d --force-recreate
@echo "Container updated. Run 'make logs' to monitor the upgrade."
## Wipe data volume and remove container (DESTRUCTIVE — full reinstall)
clean:
@echo "WARNING: This will delete all IPA data and force a full reinstall."
@read -rp "Type 'yes' to confirm: " c && [ "$$c" = "yes" ] || exit 1
$(COMPOSE) down
docker run --rm -v "$$(pwd)/data:/data:Z" alpine sh -c 'rm -rf /data/* /data/.[!.]*'
@echo "Data wiped. Run 'make start' to reinstall."