1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
alice-lg-alice-lg/client/Makefile.docker

41 lines
888 B
Docker
Raw Normal View History

2018-07-13 11:02:32 +02:00
2018-07-18 11:00:37 +02:00
DOCKER_CONTAINER := alice-lg-node-build
2018-07-13 11:02:32 +02:00
DOCKER_IMAGE := alice-lg-node:latest
2018-07-18 11:09:59 +02:00
DOCKER_EXEC := docker run --rm -t -i \
2018-07-16 17:03:46 +02:00
-a stdin -a stdout -a stderr \
-v `pwd`:/client/ \
2018-07-18 11:00:37 +02:00
--name $(DOCKER_CONTAINER) \
2018-07-16 17:03:46 +02:00
$(DOCKER_IMAGE) /bin/bash -c
2018-07-13 11:02:32 +02:00
all: client
@echo "Built alice-lg client"
image:
docker build . -t $(DOCKER_IMAGE)
deps: image
2018-07-16 17:37:15 +02:00
$(DOCKER_EXEC) "npm install"
2018-07-13 11:02:32 +02:00
2018-07-18 11:09:59 +02:00
client: stop deps
2018-07-13 11:02:32 +02:00
@echo "Building alice UI"
2018-07-16 17:37:15 +02:00
$(DOCKER_EXEC) "./node_modules/.bin/gulp"
2018-07-13 11:02:32 +02:00
2018-07-18 11:09:59 +02:00
client_prod: stop deps
2018-07-13 11:02:32 +02:00
@echo "Building alice UI (production)"
2018-07-16 17:37:15 +02:00
$(DOCKER_EXEC) "DISABLE_LOGGING=1 NODE_ENV=production ./node_modules/.bin/gulp"
2018-07-13 11:02:32 +02:00
2018-07-16 17:03:46 +02:00
watch:
2018-07-18 10:54:16 +02:00
$(DOCKER_EXEC) "while true; do ./node_modules/.bin/gulp watch; done"
2018-07-13 11:02:32 +02:00
2018-07-18 11:00:37 +02:00
stop:
2018-07-18 11:09:59 +02:00
@echo "Stopping docker container: $(DOCKER_CONTAINER)"
-docker stop $(DOCKER_CONTAINER)
@sleep 1
2018-07-18 11:00:37 +02:00
kill:
2018-07-18 11:09:59 +02:00
@echo "Killing docker container: $(DOCKER_CONTAINER)"
-docker kill $(DOCKER_CONTAINER)
@sleep 1
2018-07-13 11:02:32 +02:00