From 2660d6a659e4bbef7c6dfaa73587d1a9e4dbf8c7 Mon Sep 17 00:00:00 2001 From: stellarshenson Date: Mon, 3 Nov 2025 20:32:39 +0100 Subject: [PATCH] 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 --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f225a79..7281925 100644 --- a/Makefile +++ b/Makefile @@ -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'