-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (27 loc) · 916 Bytes
/
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
all: build up
build:
@sudo grep "^127.0.0.1.*athirion.42.fr$$" /etc/hosts >/dev/null; \
if [ $$? -eq 1 ]; then \
sudo sed -i 's/^127.0.0.1.*localhost$$/127.0.0.1 localhost\n127.0.0.1 athirion.42.fr/' /etc/hosts; \
fi
@if [ ! -d "/home/athirion/data/mariadb" ]; then \
sudo mkdir -p /home/athirion/data/mariadb; \
fi
@if [ ! -d "/home/athirion/data/wordpress" ]; then \
sudo mkdir -p /home/athirion/data/wordpress; \
fi
@docker-compose -f srcs/docker-compose.yml build
up:
@docker-compose -f srcs/docker-compose.yml up -d
start:
@docker-compose -f srcs/docker-compose.yml start
stop:
@docker-compose -f srcs/docker-compose.yml stop
clean:
@docker-compose -f srcs/docker-compose.yml down -v
@sudo rm -rf /home/athirion/data/mariadb
@sudo rm -rf /home/athirion/data/wordpress
fclean: clean
@docker system prune -af
re: fclean all
.PHONY : all build up start stop clean fclean re