-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (24 loc) · 830 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
DATA_DIR ?= ./data
COMPOSE_FLAGS = -f ./srcs/docker-compose.yaml
all: up
up: hostname docker-mounts
sudo docker compose ${COMPOSE_FLAGS} up -d
debug: hostname docker-mounts
sudo docker compose ${COMPOSE_FLAGS} up --build
down:
sudo docker compose ${COMPOSE_FLAGS} down
build:
sudo docker compose ${COMPOSE_FLAGS} build --no-cache
clean:
sudo docker compose ${COMPOSE_FLAGS} down --rmi all --remove-orphans
fclean: clean
sudo rm -rf /home/vgoncalv/data
sudo sed -in '/127.0.0.1 vgoncalv.42.fr/d' /etc/hosts
re: fclean all
docker-mounts:
sudo mkdir -p ${DATA_DIR}/mariadb
sudo mkdir -p ${DATA_DIR}/wordpress
sudo mkdir -p ${DATA_DIR}/adminer
hostname:
grep -q "vgoncalv.42.fr" /etc/hosts || echo "127.0.0.1 vgoncalv.42.fr" | sudo tee -a /etc/hosts
.PHONY: all up debug down build clean fclean re docker-mounts