1
0
mirror of https://github.com/Chipazawra/v8-1c-cluster-pde.git synced 2024-11-21 16:46:33 +02:00

add Dockerfile

This commit is contained in:
Anton 2021-12-28 14:46:52 +03:00
parent 66331f413a
commit be7a9c8bb0

19
Dockerfile Normal file
View 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"]