You've already forked v8-1c-cluster-pde
mirror of
https://github.com/Chipazawra/v8-1c-cluster-pde.git
synced 2025-11-06 08:49:31 +02:00
add Dockerfile
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# 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"]
|
||||||
Reference in New Issue
Block a user