-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 894 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (29 loc) · 894 Bytes
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
NAME := inception
COMPOSE := docker compose -f srcs/docker-compose.yml
ENV_FILE := srcs/.env
WP_DATA := /home/anikitin/data/wordpress
DB_DATA := /home/anikitin/data/mariadb
all: up
dirs:
@mkdir -p $(WP_DATA)
@mkdir -p $(DB_DATA)
up: dirs
@printf "Starting $(NAME)...\n"
@$(COMPOSE) --env-file $(ENV_FILE) up --build
build: dirs
@printf "Building $(NAME)...\n"
@$(COMPOSE) --env-file $(ENV_FILE) build
down:
@printf "Stopping $(NAME)...\n"
@$(COMPOSE) --env-file $(ENV_FILE) down
logs:
@$(COMPOSE) --env-file $(ENV_FILE) logs -f
clean:
@printf "Cleaning containers and volumes for $(NAME)...\n"
@$(COMPOSE) --env-file $(ENV_FILE) down --volumes
fclean:
@printf "Full cleanup of $(NAME)...\n"
@$(COMPOSE) --env-file $(ENV_FILE) down --rmi all --volumes --remove-orphans
@sudo rm -rf $(WP_DATA) $(DB_DATA)
re: fclean all
.PHONY: all dirs up build down logs clean fclean re