From 54d8032798698f6e0750d007f8a2799deafd10f4 Mon Sep 17 00:00:00 2001 From: Felipe Cardoso Date: Thu, 27 Feb 2025 13:47:13 +0100 Subject: [PATCH] Add deployment and image push support to Makefile Introduced a new `deploy` target for deploying services and a `push-images` target for building and pushing Docker images. Added a default `VERSION` and `REGISTRY` variable for streamlined image tagging and registry management. Included a `docker-compose.deploy.yml` file for deployment configuration. --- Makefile | 16 +++++++++++++++- docker-compose.deploy.yml | 0 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 docker-compose.deploy.yml diff --git a/Makefile b/Makefile index 90b9d53..bd3bc82 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ .PHONY: dev prod down clean +VERSION ?= latest +REGISTRY := gitea.pragmazest.com/cardosofelipe/eventspace + + dev: docker compose -f docker-compose.dev.yml up --build -d @@ -9,5 +13,15 @@ prod: down: docker compose down +deploy: + docker compose -f docker-compose.deploy.yml pull + docker compose -f docker-compose.deploy.yml up -d + clean: - docker compose down -v \ No newline at end of file + docker compose down - + +push-images: + docker build -t $(REGISTRY)/backend:$(VERSION) ./backend + docker build -t $(REGISTRY)/frontend:$(VERSION) ./frontend + docker push $(REGISTRY)/backend:$(VERSION) + docker push $(REGISTRY)/frontend:$(VERSION) \ No newline at end of file diff --git a/docker-compose.deploy.yml b/docker-compose.deploy.yml new file mode 100644 index 0000000..e69de29