generated from dragonfish/node-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
59 lines (49 loc) · 1.5 KB
/
Taskfile.yaml
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
version: "3"
vars:
PROJECT_NAME: payments-service
API_IMAGE_NAME: "{{.PROJECT_NAME}}-api-server"
# EVENT_IMAGE_NAME: "{{.PROJECT_NAME}}-event"
TAG: latest
API_PATH: ./cmd/api-server
# EVENT_PATH: ./cmd/event-handler
tasks:
build-api:
desc: Build the API server Docker image
cmds:
- docker build -t {{.API_IMAGE_NAME}}:{{.TAG}} .
# build-event:
# desc: Build the Event Handler Docker image
# cmds:
# - docker build
# --build-arg PROGRAM_PATH={{.EVENT_PATH}}
# -t {{.EVENT_IMAGE_NAME}}:{{.TAG}} .
build:
desc: Build both Docker images
deps: [build-api]
run-api:
desc: Run the API server container
cmds:
- docker run -d --name {{.API_IMAGE_NAME}}-container {{.API_IMAGE_NAME}}:{{.TAG}}
# run-event:
# desc: Run the Event Handler container
# cmds:
# - docker run -d --name {{.EVENT_IMAGE_NAME}}-container {{.EVENT_IMAGE_NAME}}:{{.TAG}}
stop-api:
desc: Stop and remove the API server container
cmds:
- docker stop {{.API_IMAGE_NAME}}-container
- docker rm {{.API_IMAGE_NAME}}-container
# stop-event:
# desc: Stop and remove the Event Handler container
# cmds:
# - docker stop {{.EVENT_IMAGE_NAME}}-container
# - docker rm {{.EVENT_IMAGE_NAME}}-container
clean:
desc: Remove Docker images
cmds:
- docker rmi {{.API_IMAGE_NAME}}:{{.TAG}}
# - docker rmi {{.EVENT_IMAGE_NAME}}:{{.TAG}}
default:
desc: Display help information
cmds:
- task --list