This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (32 loc) · 1.71 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jgo <jgo@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/08/22 14:12:09 by jgo #+# #+# #
# Updated: 2023/08/22 14:34:42 by jgo ### ########.fr #
# #
# **************************************************************************** #
DATA_DIR := /home/$(shell whoami)/data
MARIADB_DATA_DIR := $(DATA_DIR)/mariadb_data
WORDPRESS_DATA_DIR := $(DATA_DIR)/wordpress_data
mandatory: $(DATA_DIR) $(MARIADB_DATA_DIR) $(WORDPRESS_DATA_DIR)
docker-compose -f ./srcs/docker-compose.yml up mariadb wp_php nginx -d --build
bonus all: $(DATA_DIR) $(MARIADB_DATA_DIR) $(WORDPRESS_DATA_DIR)
docker-compose -f ./srcs/docker-compose.yml up -d --build
clean:
docker-compose -f ./srcs/docker-compose.yml down
fclean: clean
docker-compose -f ./srcs/docker-compose.yml down -v
sudo rm -rf $(MARIADB_DATA_DIR)/* $(WORDPRESS_DATA_DIR)/*
docker image prune -f
docker builder prune -f
docker volume prune -f
docker network prune -f
re: fclean
$(MAKE) all
$(DATA_DIR) $(MARIADB_DATA_DIR) $(WORDPRESS_DATA_DIR):
mkdir -p $@
.PHONY: all clean fclean re $(DATA_DIR) $(MARIADB_DATA_DIR) $(WORDPRESS_DATA_DIR)