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
2021-12-28 14:46:52 +03:00

19 lines
410 B
Docker

# 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"]