-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (51 loc) · 1.69 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
#!/usr/bin/env make -f
# -*- makefile -*-
SHELL = bash -e
all_ps_hashes = $(shell docker ps -q)
img_hash = $(shell docker images -q luisalejandro/luisalejandro.org:latest)
exec_on_docker = docker compose \
-p luisalejandro -f docker-compose.yml exec \
--user luisalejandro app
image:
@docker compose -p luisalejandro -f docker-compose.yml build \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g)
start:
@if [ -z "$(img_hash)" ]; then\
make image;\
fi
@docker compose -p luisalejandro -f docker-compose.yml up \
--remove-orphans --no-build --detach
dependencies: start
@$(exec_on_docker) yarn install
build_production: start
@$(exec_on_docker) yarn run build
serve: start
@$(exec_on_docker) yarn dev
console: start
@$(exec_on_docker) bash
stop:
@docker-compose -p luisalejandro -f docker-compose.yml stop app
down:
@docker-compose -p luisalejandro -f docker-compose.yml down \
--remove-orphans
destroy:
@echo
@echo "WARNING!!!"
@echo "This will stop and delete all containers, images and volumes related to this project."
@echo
@read -p "Press ctrl+c to abort or enter to continue." -n 1 -r
@docker compose -p luisalejandro -f docker-compose.yml down \
--rmi all --remove-orphans --volumes
cataplum:
@echo
@echo "WARNING!!!"
@echo "This will stop and delete all containers, images and volumes present in your system."
@echo
@read -p "Press ctrl+c to abort or enter to continue." -n 1 -r
@if [ -n "$(all_ps_hashes)" ]; then\
docker kill $(shell docker ps -q);\
fi
@docker compose -p luisalejandro -f docker-compose.yml down \
--rmi all --remove-orphans --volumes
@docker system prune -a -f --volumes