basket-service/Dockerfile.server
Piotr Biernat 005dbd53bc
Some checks failed
continuous-integration/drone/push Build is failing
Huge refactoring
2022-11-29 22:42:26 +01:00

31 lines
588 B
Docker

# Builder
FROM golang:alpine AS builder
ARG BIN_OUTPUT=/go/bin/server
ARG GO_MAIN=cmd/server/main.go
WORKDIR /go/src/app
COPY src ./
RUN go mod download && \
export CGO_ENABLED=0 ; export GOOS=linux ; export GOARCH=amd64 && \
go build -ldflags="-w -s" -o $BIN_OUTPUT $GO_MAIN
# Destination image - server
FROM gcr.io/distroless/base-debian10
ARG BIN_OUTPUT=/go/bin/server
LABEL author="Piotr Biernat"
LABEL service="basket-svc"
LABEL vendor="Egommerce"
LABEL version="1.0"
WORKDIR /
COPY --from=builder $BIN_OUTPUT /
COPY .env.dist /.env
EXPOSE 80
ENTRYPOINT ["/server"]