forked from Paches19/transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (51 loc) · 1.99 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Transcendence
NAME = transcendence
PORT = 443
# Ruta de los archivos docker-compose
DOCKER_COMPOSE_FILE = src/docker/docker-compose.yml
# Colours
RED = \033[0;31m
GREEN = \033[0;32m
YELLOW = \033[0;33m
BLUE = \033[0;34m
PURPLE = \033[0;35m
CYAN = \033[0;36m
WHITE = \033[0;37m
RESET = \033[0m
# Rules
all: $(NAME)
$(NAME):
@printf "\n$(BLUE)==> $(CYAN)Building Transcendence 🏗️\n\n$(RESET)"
@echo "Using compose files: $(DOCKER_COMPOSE_FILE)"
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) up -d --remove-orphans
@printf "\n$(BLUE)==> $(CYAN)Transcendence is running ✅\n$(RESET)"
@printf "$(BLUE)==> $(BLUE)Accessible on: \n\t$(YELLOW)https://localhost:8080\n$(RESET)"
stop:
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) stop
@printf "\n$(BLUE)==> $(RED)Transcendence stopped 🛑\n$(RESET)"
logs-django:
docker logs -f django
logs-nginx:
docker logs -f nginx
logs-postgres:
docker logs -f postgres
clean: stop
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) down
@printf "\n$(BLUE)==> $(RED)Removed Transcendence 🗑️\n$(RESET)"
fclean:
@docker rmi -f $(shell docker images -q)
@docker rm -f $(shell docker ps -aq)
@docker network rm $(shell docker network ls -q)
@printf "\n$(BLUE)==> $(RED)Fully cleaned Transcendence 🗑️\n$(RESET)"
re: clean
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) up -d --build
@printf "$(BLUE)==> $(CYAN)Transcendence rebuilt 🔄\n$(RESET)"
@printf "\n$(BLUE)==> $(CYAN)Transcendence is running ✅\n$(RESET)"
@printf "$(BLUE)==> $(BLUE)Accessible on: \n\t$(YELLOW)https://localhost:8080\n$(RESET)"
re-postgres:
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) up -d --no-deps --build postgres
re-django:
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) up -d --no-deps --build django
re-nginx:
@docker-compose -p $(NAME) -f $(DOCKER_COMPOSE_FILE) up -d --no-deps --build nginx
.PHONY: all stop clean fclean re re-postgres re-django re-nginx