From d9016a51f1eabaea3486fae345d065f8e20affc3 Mon Sep 17 00:00:00 2001 From: Henry Whitaker Date: Fri, 19 Apr 2024 15:43:40 +0100 Subject: [PATCH] chore: added docker tasks --- Taskfile.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Taskfile.yaml b/Taskfile.yaml index 03a3cfa..440b182 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -21,3 +21,27 @@ tasks: desc: Run the http server cmds: - go run main.go serve + + docker:build: + desc: Build the docker image + requires: + vars: + - tag + cmds: + - docker build . -t henrywhitaker3/prompage:{{ .tag }} + + docker:run: + desc: Build and run the docker image + vars: + tag: + sh: head -n 10 /dev/random | md5sum | cut -c1-6 + cmds: + - task: docker:build + vars: + tag: '{{ .tag }}' + - docker run --net=host --rm -v $(pwd)/prompage.yaml:/prompage.yaml henrywhitaker3/prompage:{{ .tag }} {{ .CLI_ARGS }} + + default: + silent: true + cmds: + - task -l