-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
42 lines (34 loc) · 1.03 KB
/
Copy pathTaskfile.yaml
File metadata and controls
42 lines (34 loc) · 1.03 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
version: '3'
tasks:
default:
desc: "Build and run the Docker container"
deps: [build, run]
build:
desc: "Build the Docker image"
cmds:
- "docker build -t my-app ."
# This was original run command. For now we run bash
run:
desc: "Run the Docker container"
cmds:
- "docker rm -f my-app || true" # Remove any existing container
- "docker run -v $PWD/content:/content -p 8080:8080 --name my-app my-app"
stop:
desc: "Stop the Docker container"
cmds:
- "docker stop my-app || true"
restart:
desc: "Restart the Docker container"
deps: [stop, run]
logs:
desc: "Follow logs of the Docker container"
cmds:
- "docker logs -f my-app"
bash:
desc: "Connect to container's prompt"
cmds:
- "docker run -it -v $(pwd)/content:/content -p 8080:8080 --entrypoint '/bin/bash' my-app || true"
taskfile-demo:
desc: "Run default task"
cmds:
- "docker run -it -v $(pwd)/content:/content -p 8080:8080 --entrypoint 'task' my-app || true"