-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (51 loc) · 1.11 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
55
56
57
58
59
60
61
62
63
64
65
project_name = articpad
image_name = articpad:latest
.PHONY: run-local
run-local:
go run main.go
.PHONY: run-local-frontend
run-local-frontend:
cd ui && npm run dev
.PHONY: build-local
build-local:
go build -o $(project_name) main.go
.PHONY: build-local-frontend
build-local-frontend:
cd ui && npm run build
.PHONY: requirements
requirements:
go mod tidy
cd ui && npm install
.PHONY: clean
clean-packages:
go clean -modcache
.PHONY: up
up:
make up-silent
make shell
.PHONY: build
build:
make build-local
make build-local-frontend
docker build -t $(image_name) .
.PHONY: build-no-cache
build-no-cache:
make build-local
make build-local-frontend
docker build --no-cache -t $(image_name) .
.PHONY: up-silent
up-silent:
make delete-container-if-exist
docker run -d -p 8080:8080 --name $(project_name) $(image_name)
.PHONY: delete-container-if-exist
delete-container-if-exist:
docker stop $(project_name) || true && docker rm $(project_name) || true
.PHONY: shell
shell:
docker exec -it $(project_name) /bin/sh
.PHONY: stop
stop:
docker stop $(project_name)
.PHONY: start
start:
docker start $(project_name)