From 1ae69ef9533db2c0722bd8aa84d0377869d00988 Mon Sep 17 00:00:00 2001 From: robo-mop Date: Wed, 11 Sep 2024 10:06:53 +0530 Subject: [PATCH] Add Makefile for docker deploy commands --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..c0f7c7e33 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +DEPLOY_DOCKER_DIR := ./deploy/docker +DEPLOY_GITLAB_DIR := ./deploy/services/gitlab + +.PHONY: start-localhost stop-localhost +.PHONY: start-http stop-http +.PHONY: start-https stop-https +.PHONY: start-gitlab stop-gitlab + +# Running the local gitlab instance (takes a few minutes) +start-gitlab: + cd $(DEPLOY_GITLAB_DIR) && \ + docker compose up -d + +stop-gitlab: + cd $(DEPLOY_GITLAB_DIR) && \ + docker compose down + +# Running the server on localhost +start-localhost: + docker compose -f $(DEPLOY_DOCKER_DIR)/compose.local.yml --env-file $(DEPLOY_DOCKER_DIR)/.env.local up -d + +stop-localhost: + docker compose -f $(DEPLOY_DOCKER_DIR)/compose.local.yml --env-file $(DEPLOY_DOCKER_DIR)/.env.local down + +# Running the server at http:// +start-http: + docker compose -f $(DEPLOY_DOCKER_DIR)/compose.server.yml --env-file $(DEPLOY_DOCKER_DIR)/.env.server up -d + +stop-http: + docker compose -f $(DEPLOY_DOCKER_DIR)/compose.server.yml --env-file $(DEPLOY_DOCKER_DIR)/.env.server down + +# Running the server at https:// +start-https: + docker compose -f $(DEPLOY_DOCKER_DIR)/compose.server.secure.yml --env-file $(DEPLOY_DOCKER_DIR)/.env.server up -d + +stop-https: + docker compose -f $(DEPLOY_DOCKER_DIR)/compose.server.secure.yml --env-file $(DEPLOY_DOCKER_DIR)/.env.server down