-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (47 loc) · 1.72 KB
/
makefile
File metadata and controls
61 lines (47 loc) · 1.72 KB
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
55
56
57
58
59
60
61
# ================================================================== *
# Makefile help *
# ================================================================== *
define USAGE
Holiday Countdown ⚙️
Commands:
BASE:
build : Build Docker image
run : Run Docker image
destroy_empty : Destroy empty docker images
_____________________________________________
VUE:
serve : Run local Vue instance
build_vue : Builds vue app
fix_vue : Vue linting
_____________________________________________
endef
export USAGE
# ================================================================== *
# Docker Variables *
# ================================================================== *
PREFIX=remcoha
APP_NAME=holidaycountdown
IMG_REGISTRY=docker.io/$(PREFIX)
VERSION=0.0.1
LOCAL_PORT=8080
EXPOSE_PORT=3100
IMG_NAME=$(IMG_REGISTRY)/$(APP_NAME):$(VERSION)
# ================================================================== *
# Docker Utils *
# ================================================================== *
help:
@echo "$$USAGE"
destroy_empty:
docker rmi $$(docker images --filter "dangling=true" -q --no-trunc)
# ================================================================== *
# Docker specific tasks *
# ================================================================== *
build:
docker build -t $(IMG_NAME) .
run:
docker run -d -p $(EXPOSE_PORT):$(LOCAL_PORT) $(IMG_NAME)
buildrun: build run
stats:
@docker ps --format 'CONTAINER ID : {{.ID}} | Name: {{.Names}} | Image: {{.Image}} | Ports: {{.Ports}}'
stop: ## Stop and remove a running container
docker stop $$(docker ps -q --filter ancestor=$(PREFIX)/$(APP_NAME):$(VERSION) --format="{{.ID}}" )