-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (59 loc) · 1.97 KB
/
Makefile
File metadata and controls
71 lines (59 loc) · 1.97 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
67
68
69
70
71
# Variables for image caching
CACHE_DIR := cache
CACHE_FILE := $(CACHE_DIR)/silentdisco-images.tar
IMAGES := silentdisco-web:offline silentdisco-streamer:offline
.PHONY: help env sink up down logs rebuild clean
help:
@echo "Targets:"
@echo " make sink - Create persistent Pulse/pipewire virtual sink 'MixxxMaster'"
@echo " make env - Detect Pulse source and write .env (prefers MixxxMaster.monitor)"
@echo " make up - Build and start containers"
@echo " make up-offline - Build and start containers (offline)"
@echo " make down - Stop containers"
@echo " make logs - Tail logs"
@echo " make rebuild - Rebuild images and restart"
@echo " save-cache - Build then save images to $(CACHE_FILE)"
@echo " save-cache-gz - As above, gzipped"
@echo " load-cache - Load images from cache (tar or tar.gz)"
@echo " clean-images - Remove the tagged images from local cache"
@echo " make clean - Remove containers and images"
sink:
@./scripts/setup_mixxx_sink.sh
env:
@./scripts/detect_pulse.sh || true
@echo "If PULSE_SOURCE is empty, run 'make sink' and then 'make env' again."
up:
docker compose build
docker compose up -d
down:
docker compose down
logs:
docker compose logs -f --tail=200
build:
docker compose build
rebuild:
docker compose down
docker compose build --no-cache
docker compose up -d
up-offline:
@./scripts/offline_boot.sh
save-cache: build
mkdir -p $(CACHE_DIR)
docker save -o $(CACHE_FILE) $(IMAGES)
@echo "Saved image bundle: $(CACHE_FILE)"
save-cache-gz: save-cache
gzip -f $(CACHE_FILE)
@echo "Saved image bundle: $(CACHE_FILE).gz"
load-cache:
@if [ -f "$(CACHE_FILE).gz" ]; then \
gunzip -c "$(CACHE_FILE).gz" | docker load; \
elif [ -f "$(CACHE_FILE)" ]; then \
docker load -i "$(CACHE_FILE)"; \
else \
echo "No cache tar found in $(CACHE_DIR)"; exit 1; \
fi
clean-images:
@for img in $(IMAGES); do docker image rm $$img || true; done
clean:
docker compose down --rmi all -v --remove-orphans || true
rm -f .env