-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (23 loc) · 987 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
all: up
# check if itaureli.42.fr is in /etc/hosts, if not add it
# then create all volume folders
# then compose up
up:
sudo chmod 777 /etc/hosts && sudo cat /etc/hosts | sudo grep itaureli.42.fr || \
sudo echo "127.0.0.1 itaureli.42.fr" >> /etc/hosts
sudo mkdir -p /home/itaureli/data/wordpress && sudo chmod 777 /home/itaureli/data/wordpress
sudo mkdir -p /home/itaureli/data/mariadb && sudo chmod 777 /home/itaureli/data/mariadb
docker-compose -f srcs/docker-compose.yml up -d
down:
docker-compose -f srcs/docker-compose.yml down
# down, remove all volume folders and remove itaureli.42.fr from /etc/hosts
clean: down
docker stop $$(docker ps -qa); \
docker rm $$(docker ps -qa); \
docker rmi -f $$(docker images -qa); \
docker volume rm $$(docker volume ls -q); \
docker network rm $$(docker network ls -q); \
sudo rm -rf /home/itaureli/data
sudo sed -i '/127.0.0.1 itaureli.42.fr/d' /etc/hosts
fclean: clean
sudo docker system prune --volumes --all --force