-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 933 Bytes
/
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
# Variables
BUILD_TAG = champdle:latest
CONTAINER_NAME = champdle
HTTPS_PORT = 443
HTTP_PORT = 80
# PHONY Rule
.PHONY: all start build stop clean ngrok
# Rules
all: start
start:
@echo "Champdle: Starting '$(CONTAINER_NAME)'"
@docker start $(CONTAINER_NAME) > /dev/null
build:
@echo "Champdle: Building '$(BUILD_TAG)'"
@echo ""
@docker build -t $(BUILD_TAG) .
@echo ""
@echo "Champdle: Creating Image '$(CONTAINER_NAME)'"
@docker create -p $(HTTPS_PORT):443 -p $(HTTP_PORT):80 --name $(CONTAINER_NAME) $(BUILD_TAG) > /dev/null
stop:
@echo "Champdle: Stopping '$(CONTAINER_NAME)'"
@docker stop $(CONTAINER_NAME) > /dev/null
clean:
@echo "Champdle: Removing '$(CONTAINER_NAME)'"
@docker rm $(CONTAINER_NAME) > /dev/null
restart: stop start
rebuild: clean build
reload: stop clean build start
ngrok:
@echo "Launching ngrok's temporary server listening on port '$(HTTPS_PORT)'"
@./bin/ngrok http $(HTTPS_PORT)