-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (37 loc) · 1.91 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
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
all:
frontend-dev:
cd $(mkfile_dir)/frontend; npm run dev;
backend-dev:
cd $(mkfile_dir)/backend; uvicorn main:app --reload;
# Build Docker Images
build-frontend:
docker build --network=host -t registry.gitlab.com/maomaocake/smart-farm/frontend $(mkfile_dir)/frontend
build-backend:
docker build --network=host -t registry.gitlab.com/maomaocake/smart-farm/backend $(mkfile_dir)/backend
build-frontend-no-cache:
docker build --no-cache --network=host -t registry.gitlab.com/maomaocake/smart-farm/frontend $(mkfile_dir)/frontend
build-backend-no-cache:
docker build --no-cache --network=host -t registry.gitlab.com/maomaocake/smart-farm/backend $(mkfile_dir)/backend
build-backend-worker-no-cache:
docker build --no-cache --network=host -t registry.gitlab.com/maomaocake/smart-farm/backend-worker $(mkfile_dir)/backend-worker
build-mqtt-bridge:
docker build --no-cache --network=host -t registry.gitlab.com/maomaocake/smart-farm/mqtt-bridge $(mkfile_dir)/mqtt-bridge
build-mqtt2db:
docker build --no-cache --network=host -t registry.gitlab.com/maomaocake/smart-farm/mqtt2db $(mkfile_dir)/hardware/mqtt2db
build-docker:build-frontend-no-cache build-backend-no-cache build-backend-worker-no-cache build-mqtt2db
# Docker Commands
push-dockers:
docker push registry.gitlab.com/maomaocake/smart-farm/frontend:latest
docker push registry.gitlab.com/maomaocake/smart-farm/backend:latest
docker push registry.gitlab.com/maomaocake/smart-farm/backend-worker:latest
docker push registry.gitlab.com/maomaocake/smart-farm/mqtt2db:latest
run-frontend:
docker run -it --rm -d -p 3000:3000 --name frontend registry.gitlab.com/maomaocake/smart-farm/frontend
run-backend:
docker run -it --rm -d -p 8000:8000 --name backend registry.gitlab.com/maomaocake/smart-farm/backend
run-all-docker:
docker-compose up -d
stop-all-docker:
docker-compose down