feat: add stop target to makefile

- Add stop target to gracefully stop and remove containers
- Respects compose_override.yml if present
- Stops containers without removing images or volumes
This commit is contained in:
stellarshenson
2025-11-03 20:32:39 +01:00
parent a18024f1d9
commit 2660d6a659

View File

@@ -4,7 +4,7 @@
# GLOBALS #
#################################################################################
.DEFAULT_GOAL := help
.PHONY: help build push start clean increment_version tag
.PHONY: help build push start stop clean increment_version tag
# Include project configuration
include project.env
@@ -61,6 +61,15 @@ tag:
start:
@./start.sh
## stop and remove containers
stop:
@echo 'stopping and removing containers'
@if [ -f './compose_override.yml' ]; then \
docker compose --env-file .env -f compose.yml -f compose_override.yml down; \
else \
docker compose --env-file .env -f compose.yml down; \
fi
## clean orphaned containers
clean:
@echo 'removing dangling and unused images, containers, nets and volumes'