1
0
mirror of https://github.com/Chipazawra/v8-1c-cluster-pde.git synced 2024-12-25 01:32:38 +02:00
v8-1c-cluster-pde/Dockerfile

19 lines
410 B
Docker
Raw Permalink Normal View History

2021-12-28 13:46:52 +02:00
# Step 1: Modules caching
FROM golang:1.17.1-alpine3.14 as modules
COPY go.mod go.sum /modules/
WORKDIR /modules
RUN go mod download
# Step 2: Builder
FROM golang:1.17.1-alpine3.14 as builder
COPY --from=modules /go/pkg /go/pkg
COPY . /app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o /bin/app ./cmd/app
# Step 3: Final
FROM scratch
COPY --from=builder /bin/app /app
CMD ["/app"]