-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
46 lines (37 loc) · 795 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
37
38
39
40
41
42
43
44
45
46
image_name = site-archifiltre
pwd = $(shell pwd)
all: devServer
runProd : prod
sudo docker run \
--network=host \
-it \
$(image_name):prod
devServer: dev
sudo docker run \
--network=host \
--mount type=bind,source=$(pwd),target=/mnt,readonly \
-it \
$(image_name):dev
dev: cleanContainer
sudo docker build \
--network=host \
--target=dev \
--tag=$(image_name):dev \
.
prod: cleanContainer
sudo docker build \
--network=host \
--tag=$(image_name):prod \
.
clean: cleanContainer
cleanContainer:
sudo docker container prune -f
install: prod
sudo rm -fr ./docs
sudo docker run \
-d \
--name=$(image_name) \
$(image_name):prod sh
sudo docker cp $(image_name):/usr/src/app/dist ./docs
sudo docker container rm $(image_name)
sudo chmod -R 777 ./docs