alice-lg/client/Makefile.docker
2021-04-16 10:21:53 +02:00

42 lines
918 B
Docker

DOCKER := docker
DOCKER_CONTAINER := alice-lg-node-build
DOCKER_IMAGE := alice-lg-node:latest
DOCKER_EXEC := $(DOCKER) run --rm -t -i \
-a stdin -a stdout -a stderr \
-v `pwd`:/client/ \
--name $(DOCKER_CONTAINER) \
$(DOCKER_IMAGE) /bin/bash -c
all: client
@echo "Built alice-lg client"
image:
$(DOCKER) build . -t $(DOCKER_IMAGE)
deps: image
$(DOCKER_EXEC) "yarn install"
client: stop deps
@echo "Building alice UI"
$(DOCKER_EXEC) "./node_modules/.bin/gulp"
client_prod: stop deps
@echo "Building alice UI (production)"
$(DOCKER_EXEC) "DISABLE_LOGGING=1 NODE_ENV=production ./node_modules/.bin/gulp"
watch:
$(DOCKER_EXEC) "while true; do ./node_modules/.bin/gulp watch; done"
stop:
@echo "Stopping docker container: $(DOCKER_CONTAINER)"
-$(DOCKER) stop $(DOCKER_CONTAINER)
@sleep 1
kill:
@echo "Killing docker container: $(DOCKER_CONTAINER)"
-$(DOCKER) kill $(DOCKER_CONTAINER)
@sleep 1