forked from lairdm/psortb-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (42 loc) · 1.33 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
54
# Build a PSORTb container
# By Matthew Laird <[email protected]>
NAME = psortb
IMAGE_REPO = lairdm
VERSION = 1.0.0
IMAGE_NAME = $(IMAGE_REPO)/$(NAME)
DOMAIN = psort.org
all:: help
help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " make build - Build image $(IMAGE_NAME)"
@echo " make push - Push $(IMAGE_NAME) to public docker repo"
@echo " make run - Run $(NAME) container"
@echo " make start - Start the EXISTING $(NAME) container"
@echo " make stop - Stop $(NAME) container"
@echo " make restart - Stop and start $(NAME) container"
@echo " make remove - Stop and remove $(NAME) container"
@echo " make state - View state $(NAME) container"
@echo " make logs - View logs in real time"
build:
docker build --rm --no-cache -t $(IMAGE_NAME):$(VERSION) .
push:
docker push $(IMAGE_NAME):$(VERSION)
run:
docker run -d -p 80:80 -e NODE_ENVIRONMENT="production" --restart=always --name $(NAME) $(IMAGE_NAME):$(VERSION)
start:
@echo "Starting $(NAME)..."
docker start $(NAME) > /dev/null
stop:
@echo "Stopping $(NAME)..."
docker stop $(NAME) > /dev/null
restart: stop start
remove: stop
@echo "Removing $(NAME)..."
docker rm $(NAME) > /dev/null
state:
docker ps -a | grep $(NAME)
logs:
@echo "Build $(NAME)..."
docker logs -f $(NAME)