Skip to content

Commit

Permalink
chore: use taskfile for container building
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenwinter committed Mar 11, 2023
1 parent 59c2fd5 commit 87e2cdf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . ./
RUN go build -v -o gotrxx
RUN go install github.com/go-task/task/v3/cmd/task@latest
RUN task build
RUN mkdir -p -v /data/gotrxx

FROM gcr.io/distroless/base-debian11:nonroot
WORKDIR /app
COPY --from=builder --chown=nonroot:nonroot /app/gotrxx /app/gotrxx
COPY --from=builder --chown=nonroot:nonroot /app/bin/gotrxx /app/gotrxx
COPY --from=builder --chown=nonroot:nonroot /data/gotrxx /data/gotrxx
USER nonroot:nonroot
CMD ["/app/gotrxx"]
6 changes: 6 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ tasks:
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h

build:container:
desc: "build the docker container"
cmds:
- docker build -t ghcr.io/eisenwinter/gotrxx:dev .

assets:sass:
desc: "Rebuilds the sass unminified"
cmds:
Expand Down

0 comments on commit 87e2cdf

Please sign in to comment.