From a0a6e8301ab1cd0f18f10ea40fba13f40b3fb638 Mon Sep 17 00:00:00 2001 From: D4rkHeart <leonardo.surdez@gmail.com> Date: Tue, 12 Sep 2023 14:06:33 +0200 Subject: [PATCH] [Feat] Makefile set-up - Create commands : up,stop,start,build,list,restart - Add a variable for the file path to make it easier to read - Add the creation of a network if one has not already been created --- Docker/Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Docker/Makefile diff --git a/Docker/Makefile b/Docker/Makefile new file mode 100644 index 0000000..5839595 --- /dev/null +++ b/Docker/Makefile @@ -0,0 +1,24 @@ +DC = docker compose -f ./docker-compose-dev.yml +up: network + $(DC) up -d + +stop: + $(DC) down + +start: up + $(DC) exec gest sh -c 'npm i --no-funding' + $(DC) exec api bash -c 'composer update && composer install' + +build: + $(DC) build + +list: + $(DC) ps + +restart: stop up + +network: + if [ -z "$$(docker network ls -q -f name=canap_network)" ]; then \ + docker network create canap_network; \ + fi + -- GitLab