-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (40 loc) · 1.28 KB
/
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
47
48
49
50
51
52
53
# Makefile for Node-RED-Weather-Routing-Logistic
DOCKERHUB_ID:=
IMG_NAME:="node-red-weather-routing-logistics"
IMG_VERSION:="1.0.0"
ARCH:="amd64"
# Store the secrets in a .env file (see ./.env.example)
# or modify the Makefile "run" rule below to run the
# docker container with -e environment variables
# or store them directly in the Dockerfile
TWCAPIKEY:=
HEREAPIKEY:=
WATSON_TTS:=
# Leave blank for open DockerHub containers
# CONTAINER_CREDS:=-r "registry.wherever.com:myid:mypw"
CONTAINER_CREDS:=
default: build run
build:
docker build --rm -t $(DOCKERHUB_ID)/$(IMG_NAME):$(IMG_VERSION) .
docker image prune --filter label=stage=builder --force
dev: stop build
docker run -it --name ${IMG_NAME} \
$(DOCKERHUB_ID)/$(IMG_NAME):$(IMG_VERSION) /bin/bash
run: stop
docker run -d \
--name ${IMG_NAME} \
--env-file .env \
-p 1880:1880 \
--restart unless-stopped \
$(DOCKERHUB_ID)/$(IMG_NAME):$(IMG_VERSION)
test:
xdg-open http://127.0.0.1:1880
ui:
xdg-open http://127.0.0.1:1880/ui
push:
docker push $(DOCKERHUB_ID)/$(IMG_NAME):$(IMG_VERSION)
stop:
@docker rm -f ${IMG_NAME} >/dev/null 2>&1 || :
clean:
@docker rmi -f $(DOCKERHUB_ID)/$(IMG_NAME):$(IMG_VERSION) >/dev/null 2>&1 || :
.PHONY: build dev run push test ui stop clean