vegvisir/deploy/Dockerfile.build
Piotr Biernat d84cf47b01
All checks were successful
continuous-integration/drone/push Build is passing
Merge branch 'dev/ci-docker-builder' into develop
2022-04-18 00:49:57 +02:00

23 lines
427 B
Docker

# Builder
FROM golang:alpine AS builder
WORKDIR /go/src/app
ARG MAIN_GO=pkg/main.go
# ARG HTTP_PORT=8080
# ENV HTTP_PORT {$HTTP_PORT}
COPY go.mod go.sum ./
COPY pkg ./pkg
RUN go mod download && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /go/bin/app $MAIN_GO
# Destination image
FROM gcr.io/distroless/base-debian10
COPY --from=builder /go/bin/app /app
EXPOSE $HTTP_PORT
ENTRYPOINT ["/app"]