From 68aec684d3c1903b889a310081452a3b18628ef4 Mon Sep 17 00:00:00 2001 From: fokosun Date: Sat, 25 Nov 2023 11:31:11 -0500 Subject: [PATCH] Add a make cmd to build and push the application as an image to the remote docker repository --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2ed3b5ce..a76c8efa 100755 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ help: @printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n" @grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}' -install: copy_env down build up setup +install: copy_env down build up setup down: ## Destroy the containers @docker-compose down @@ -14,6 +14,14 @@ down: ## Destroy the containers build: ## build the containers @docker-compose build +build_and_push: docker_build_image docker_push_image + +docker_build_image: + @docker build -t fokosun/cookbookshq-api:v1 . + +docker_push_image: + @docker push fokosun/cookbookshq-api:v1 + db_seed: ## seed the database @php artisan db:seed