fix: explicitly remove all named volumes in make clean
The previous 'down -v' flag is unreliable across compose implementations. Declare all four dev volumes (bangui-dev_*) and remove them explicitly with 'podman/docker volume rm' so clean always leaves a pristine state.
This commit is contained in:
19
Makefile
19
Makefile
@@ -7,17 +7,31 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# make up — start the debug stack
|
# make up — start the debug stack
|
||||||
# make down — stop the debug stack
|
# make down — stop the debug stack
|
||||||
# make clean — stop and remove all debug containers, volumes, and images
|
# make clean — stop and remove all debug containers AND volumes
|
||||||
# make logs — tail logs for all debug services
|
# make logs — tail logs for all debug services
|
||||||
# make restart — restart the debug stack
|
# make restart — restart the debug stack
|
||||||
# ──────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
COMPOSE_FILE := Docker/compose.debug.yml
|
COMPOSE_FILE := Docker/compose.debug.yml
|
||||||
|
|
||||||
|
# Compose project name (matches `name:` in compose.debug.yml).
|
||||||
|
PROJECT := bangui-dev
|
||||||
|
|
||||||
|
# All named volumes declared in compose.debug.yml.
|
||||||
|
# Compose prefixes them with the project name.
|
||||||
|
DEV_VOLUMES := \
|
||||||
|
$(PROJECT)_bangui-dev-data \
|
||||||
|
$(PROJECT)_frontend-node-modules \
|
||||||
|
$(PROJECT)_fail2ban-dev-config \
|
||||||
|
$(PROJECT)_fail2ban-dev-run
|
||||||
|
|
||||||
# Detect available compose binary.
|
# Detect available compose binary.
|
||||||
COMPOSE := $(shell command -v podman-compose 2>/dev/null \
|
COMPOSE := $(shell command -v podman-compose 2>/dev/null \
|
||||||
|| echo "podman compose")
|
|| echo "podman compose")
|
||||||
|
|
||||||
|
# Detect available container runtime (podman or docker).
|
||||||
|
RUNTIME := $(shell command -v podman 2>/dev/null || echo "docker")
|
||||||
|
|
||||||
.PHONY: up down restart logs clean
|
.PHONY: up down restart logs clean
|
||||||
|
|
||||||
## Start the debug stack (detached).
|
## Start the debug stack (detached).
|
||||||
@@ -38,5 +52,6 @@ logs:
|
|||||||
## Stop containers and remove ALL debug volumes (database, node_modules, fail2ban data).
|
## Stop containers and remove ALL debug volumes (database, node_modules, fail2ban data).
|
||||||
## This returns the environment to a clean first-run state.
|
## This returns the environment to a clean first-run state.
|
||||||
clean:
|
clean:
|
||||||
$(COMPOSE) -f $(COMPOSE_FILE) down -v --remove-orphans
|
$(COMPOSE) -f $(COMPOSE_FILE) down --remove-orphans
|
||||||
|
$(RUNTIME) volume rm $(DEV_VOLUMES) 2>/dev/null || true
|
||||||
@echo "All debug volumes removed. Run 'make up' to start fresh."
|
@echo "All debug volumes removed. Run 'make up' to start fresh."
|
||||||
|
|||||||
Reference in New Issue
Block a user