feature/ignore-self-toggle #1
21
Makefile
21
Makefile
@@ -7,7 +7,8 @@
|
|||||||
# 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 AND volumes
|
# make build — (re)build the backend image without starting
|
||||||
|
# make clean — stop, remove all containers, volumes, and local images
|
||||||
# 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
|
||||||
# ──────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────
|
||||||
@@ -25,6 +26,11 @@ DEV_VOLUMES := \
|
|||||||
$(PROJECT)_fail2ban-dev-config \
|
$(PROJECT)_fail2ban-dev-config \
|
||||||
$(PROJECT)_fail2ban-dev-run
|
$(PROJECT)_fail2ban-dev-run
|
||||||
|
|
||||||
|
# Locally-built images (compose project name + service name).
|
||||||
|
# Public images (fail2ban, node) are intentionally excluded.
|
||||||
|
DEV_IMAGES := \
|
||||||
|
$(PROJECT)_backend
|
||||||
|
|
||||||
# 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")
|
||||||
@@ -32,7 +38,7 @@ COMPOSE := $(shell command -v podman-compose 2>/dev/null \
|
|||||||
# Detect available container runtime (podman or docker).
|
# Detect available container runtime (podman or docker).
|
||||||
RUNTIME := $(shell command -v podman 2>/dev/null || echo "docker")
|
RUNTIME := $(shell command -v podman 2>/dev/null || echo "docker")
|
||||||
|
|
||||||
.PHONY: up down restart logs clean
|
.PHONY: up down build restart logs clean
|
||||||
|
|
||||||
## Start the debug stack (detached).
|
## Start the debug stack (detached).
|
||||||
up:
|
up:
|
||||||
@@ -42,6 +48,10 @@ up:
|
|||||||
down:
|
down:
|
||||||
$(COMPOSE) -f $(COMPOSE_FILE) down
|
$(COMPOSE) -f $(COMPOSE_FILE) down
|
||||||
|
|
||||||
|
## (Re)build the backend image without starting containers.
|
||||||
|
build:
|
||||||
|
$(COMPOSE) -f $(COMPOSE_FILE) build
|
||||||
|
|
||||||
## Restart the debug stack.
|
## Restart the debug stack.
|
||||||
restart: down up
|
restart: down up
|
||||||
|
|
||||||
@@ -49,9 +59,10 @@ restart: down up
|
|||||||
logs:
|
logs:
|
||||||
$(COMPOSE) -f $(COMPOSE_FILE) logs -f
|
$(COMPOSE) -f $(COMPOSE_FILE) logs -f
|
||||||
|
|
||||||
## Stop containers and remove ALL debug volumes (database, node_modules, fail2ban data).
|
## Stop containers, remove ALL debug volumes and locally-built images.
|
||||||
## This returns the environment to a clean first-run state.
|
## The next 'make up' will rebuild images from scratch and start fresh.
|
||||||
clean:
|
clean:
|
||||||
$(COMPOSE) -f $(COMPOSE_FILE) down --remove-orphans
|
$(COMPOSE) -f $(COMPOSE_FILE) down --remove-orphans
|
||||||
$(RUNTIME) volume rm $(DEV_VOLUMES) 2>/dev/null || true
|
$(RUNTIME) volume rm $(DEV_VOLUMES) 2>/dev/null || true
|
||||||
@echo "All debug volumes removed. Run 'make up' to start fresh."
|
$(RUNTIME) rmi $(DEV_IMAGES) 2>/dev/null || true
|
||||||
|
@echo "All debug volumes and local images removed. Run 'make up' to rebuild and start fresh."
|
||||||
|
|||||||
Reference in New Issue
Block a user