add dockerfile

pull/7/head
sundowndev 2021-07-07 15:46:56 +02:00
parent 590e8ca4a9
commit 0861890120
1 changed files with 14 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM golang:1.16.2-alpine
WORKDIR /app
COPY . .
RUN apk add git
RUN go mod download
VERSION=$(git describe --exact-match 2>/dev/null || git rev-parse --short HEAD)
RUN go build -ldflags="-X github.com/sundowndev/goreleaser-template.version=${VERSION}" -v -o myproject .
ENTRYPOINT ["/app/myproject"]