Makefile 1.28 KB
Newer Older
François Agneray's avatar
François Agneray committed
1
2
3
4
5
6
7
8
9
10
11
UID := $(shell id -u)
GID := $(shell id -g)

list:
	@echo ""
	@echo "Useful targets:"
	@echo ""
	@echo "  install      > install node modules dependancies (node_modules)"
	@echo "  start        > run a dev server for anis admin application (in memory)"
	@echo "  stop         > stop the dev server for anis admin application"
	@echo "  restart      > restart the dev server for anis admin (container)"
François Agneray's avatar
François Agneray committed
12
	@echo "  ng-build     > generate the angular dist application (html, css, js)"
François Agneray's avatar
François Agneray committed
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
	@echo "  log          > display anis admin container logs"
	@echo "  debug        > shell into anis admin container"
	@echo ""

install:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	-v $(CURDIR):/project \
	-w /project anis-node yarn install

start:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	--name anis-admin \
	-p 4201:4201 \
	-v $(CURDIR):/project -d \
	-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4201

stop:
	@docker stop anis-admin

restart: stop start

ng-build:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	-v $(CURDIR):/project \
	-w /project anis-node ng build --prod

log:
	@docker logs -f -t anis-admin

debug:
	@docker exec -ti anis-admin bash