-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
32 lines (28 loc) · 1014 Bytes
/
Copy pathTaskfile.yml
File metadata and controls
32 lines (28 loc) · 1014 Bytes
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
version: '3'
vars:
CONTAINER: zbinski-dev
IMAGE: zbinski-dev
PORT: '{{.PORT | default "8080"}}'
VERSION: '{{.VERSION | default "dev"}}'
tasks:
project:start:
desc: Serve the site on http://localhost:{{.PORT}} with live file edits (bind mount, no rebuild).
cmds:
- task: project:stop
- >-
docker run -d --rm --name {{.CONTAINER}}
-p {{.PORT}}:80
-v {{.ROOT_DIR}}:/usr/share/nginx/html:ro
nginx:alpine
- echo "http://localhost:{{.PORT}}"
project:stop:
desc: Stop the running container, whichever task started it.
cmds:
- docker rm -f {{.CONTAINER}} >/dev/null 2>&1 || true
project:preview:
desc: Build the production image exactly like the release does and serve it on http://localhost:{{.PORT}}.
cmds:
- task: project:stop
- docker build --build-arg VERSION={{.VERSION}} -t {{.IMAGE}} .
- docker run -d --rm --name {{.CONTAINER}} -p {{.PORT}}:80 {{.IMAGE}}
- echo "http://localhost:{{.PORT}}"