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

30 lines
585 B
Docker

# Builder
FROM golang:alpine AS builder
ARG BIN_OUTPUT=/go/bin/worker
ARG GO_WORKER=cmd/worker/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_WORKER
# Destination image - worker
FROM gcr.io/distroless/base-debian10
ARG BIN_OUTPUT=/go/bin/worker
LABEL author="Piotr Biernat"
LABEL service="basket-worker"
LABEL vendor="Egommerce"
LABEL version="1.0"
WORKDIR /
COPY --from=builder $BIN_OUTPUT /
COPY .env.dist /.env
ENTRYPOINT ["/worker"]