solorice/vscodium/extensions/ms-azuretools.vscode-docker-1.22.0/resources/templates/go/Dockerfile.template
2022-04-28 21:17:01 +03:00

18 lines
393 B
Docker

#build stage
FROM golang:alpine AS builder
RUN apk add --no-cache git
WORKDIR /go/src/app
COPY . .
RUN go get -d -v ./...
RUN go build -o /go/bin/app -v ./...
#final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=builder /go/bin/app /app
ENTRYPOINT /app
LABEL Name={{ serviceName }} Version={{ version }}
{{#each ports}}
EXPOSE {{ . }}
{{/each}}