-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (58 loc) · 2.57 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
67
68
69
70
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hjabbour <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/05/26 18:36:24 by hjabbour #+# #+# #
# Updated: 2023/06/25 18:45:50 by hjabbour ### ########.fr #
# #
# **************************************************************************** #
include srcs/.env
WP_DIR = /home/$(LOGIN)/data/wordpress/
# WP_DIR = /Users/$(LOGIN)/data/wordpress/
WP_FILES = $(shell ls -A $(WP_DIR))
WP_CACHE = $(addprefix $(WP_DIR), $(WP_FILES))
MARIA_DIR = /home/$(LOGIN)/data/mariadb/
# MARIA_DIR = /Users/$(LOGIN)/data/mariadb/
MARIA_FILES = $(shell ls -A $(MARIA_DIR))
MARIA_CACHE = $(addprefix $(MARIA_DIR), $(MARIA_FILES))
# mkdir -p /Users/$(LOGIN)/data/wordpress
# mkdir -p /Users/$(LOGIN)/data/mariadb
all:
mkdir -p /home/$(LOGIN)/data/wordpress
mkdir -p /home/$(LOGIN)/data/mariadb
docker compose -f srcs/docker-compose.yml up --build
# mkdir -p /Users/$(LOGIN)/data/wordpress
# mkdir -p /Users/$(LOGIN)/data/mariadb
build:
mkdir -p /home/$(LOGIN)/data/wordpress
mkdir -p /home/$(LOGIN)/data/mariadb
docker compose -f srcs/docker-compose.yml build
# mkdir -p /Users/$(LOGIN)/data/wordpress
# mkdir -p /Users/$(LOGIN)/data/mariadb
up:
mkdir -p /home/$(LOGIN)/data/wordpress
mkdir -p /home/$(LOGIN)/data/mariadb
docker compose -f srcs/docker-compose.yml up
start:
docker compose -f srcs/docker-compose.yml start
stop:
docker compose -f srcs/docker-compose.yml stop
down:
docker compose -f srcs/docker-compose.yml down
clean:
docker compose -f srcs/docker-compose.yml down
docker compose -f srcs/docker-compose.yml down -v
docker rm -f $(shell docker ps -aq) 2> /dev/null || true
docker rmi -f $(shell docker images -aq) 2> /dev/null || true
docker volume rm -f $(shell docker volume ls -q) 2> /dev/null || true
docker network rm -f $(shell docker network ls -q) 2> /dev/null || true
docker system prune -af
docker volume prune -f
docker network prune -f
rm -rf $(WP_CACHE)
rm -rf $(MARIA_CACHE)
re: clean all
.PHONY: all build up start stop down clean re