-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (47 loc) · 1.47 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
D=srcs/docker-compose.yml
ENV=srcs/.env
CONTAINERS = $(shell docker ps -a -q)
TIDY=2>/dev/null ; true
up : FORCE $(ENV) print-env
docker compose -f $D -p inception up
down :
docker compose -p inception down
clean : down
yes | docker container prune
yes | docker image prune
yes | docker network prune
yes | docker volume prune
fclean :
docker stop $(CONTAINERS) $(TIDY)
docker rm $(CONTAINERS) $(TIDY)
docker network rm $(shell docker network ls -q) $(TIDY)
docker image rm $(shell docker image ls -q) $(TIDY)
docker volume rm $(shell docker volume ls -q) $(TIDY)
ls :
docker container ls
docker image ls
docker network ls
docker volume ls
re : fclean up
data-clean :
rm -rf /home/znichola/data
mkdir -p /home/znichola/data/mariadb
mkdir -p /home/znichola/data/wordpress
mkdir -p /home/znichola/data/svelte
mkdir -p /home/znichola/data/deploy
rm srcs/.env $(TIDY)
print-env :
./srcs/requirements/tools/print_password.sh srcs/.env
ip :
docker ps -q | xargs -I{} docker inspect -f '{{.Name}} {{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {}
info : print-env ip
CN = nginx mariadb wordpress ftp_server adminer redis
$(CN) :
docker exec -it $@ /bin/bash
svelte-dev :
docker exec -it $@ /bin/zsh
$(ENV) :
@./srcs/requirements/tools/gen-env.sh
@mv .env $@
FORCE :
.PHONY: clean fclean re up down ls ${CN} svelte-dev ip print-env data-clean info