diff --git a/Makefile b/Makefile index a91fa32..7a2acf5 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ DC_RUN_ARGS = --env-file ./.env.production --profile app --profile administratio HOST_UID=$(shell id -u) HOST_GID=$(shell id -g) -.PHONY : help up down shell\:app stop-all ps update build restart down-up images\:list images\:clean logs\:app logs containers\:health +.PHONY : help up down shell\:app stop-all ps update build restart down-up images\:list images\:clean logs\:app logs containers\:health command\:app .DEFAULT_GOAL : help # This will output the help for each task. thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html @@ -32,6 +32,9 @@ down\:with-volumes: ## Stop containers and remove volumes shell\:app: ## Start shell into app container docker compose ${DC_RUN_ARGS} exec app sh +command\:app: ## Run a command in the app container + docker compose ${DC_RUN_ARGS} exec app sh -c "$(command)" + stop-all: ## Stop all containers docker stop $(shell docker ps -a -q) @@ -56,4 +59,4 @@ images\:clean: ## Remove all dangling images and images not referenced by any co docker image prune -a containers\:health: ## Check all containers health - docker compose ${DC_RUN_ARGS} ps --format "table {{.Name}}\t{{.Service}}\t{{.Status}}" \ No newline at end of file + docker compose ${DC_RUN_ARGS} ps --format "table {{.Name}}\t{{.Service}}\t{{.Status}}"