Skip to content
Snippets Groups Projects
Makefile 1.3 KiB
Newer Older
Tifenn Guillas's avatar
Tifenn Guillas committed
UID := $(id -u)
GID := $(id -g)
François Agneray's avatar
François Agneray committed

list:
	@echo ""
	@echo "Useful targets:"
	@echo ""
	@echo "  install      > install node modules dependancies (node_modules)"
	@echo "  start        > run a dev server for anis client application (in memory)"
	@echo "  stop         > stop the dev server for anis client application"
	@echo "  restart      > restart the dev server for anis client (container)"
	@echo "  ng-build     > generate the angular dist application (html, css, js)"
	@echo "  log          > display anis client container logs"
	@echo "  debug        > shell into anis client 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-client \
	-p 4200:4200 \
	-v $(CURDIR):/project -d \
	-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200

restart: stop start
François Agneray's avatar
François Agneray committed

stop:
	@docker stop anis-client

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-client

debug:
	@docker exec -ti anis-client bash