From 19d24ab958ca20fcca17625291dcf98c563efb83 Mon Sep 17 00:00:00 2001 From: hulamy Date: Sun, 25 Sep 2022 22:19:16 +0200 Subject: [PATCH] makefile correction user tab && correction make list volume content && added -d to up --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9c9a752..3c73c3c 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,12 @@ RESET = "\e[0m" COMPOSE = ./srcs/docker-compose.yml +# same as 'LOGIN' var in .env file #V_USER = $(shell echo $(USER)) # gives root when make is run with sudo #V_USER = $(shell who | head -1 | tr " " "\n" | head -1) # gives bad result when in `sudo su` #V_USER = $(shell who | head -1 | cut -d " " -f 1) # gives bad result when in `sudo su` #V_USER = $(shell users | tr " " "\n" | head -1) -V_USER = hulamy # same as 'LOGIN' var in .env file +V_USER = hulamy VOLUMES_D = /home/$(V_USER)/data/wp_volume \ /home/$(V_USER)/data/db_volume @@ -50,7 +51,7 @@ build: docker-compose -f $(COMPOSE) build up: volumes - docker-compose -f $(COMPOSE) up + docker-compose -f $(COMPOSE) up -d # list images, containers, volumes list: @@ -59,7 +60,7 @@ list: @echo $(B_YELLOW)"\nvolumes:"$(RESET) @docker volume ls @echo $(B_YELLOW)"\nvolumes content:"$(RESET) - @ls $(VOLUMES_D) + - @ls $(VOLUMES_D) @echo $(B_YELLOW)"\nnetworks:"$(RESET) @docker network ls @echo $(B_YELLOW)"\ncontainers:"$(RESET)