18 lines
305 B
Docker
18 lines
305 B
Docker
FROM golang:alpine AS builder
|
|
LABEL builder=true
|
|
WORKDIR /build
|
|
|
|
ADD go.mod .
|
|
|
|
COPY . .
|
|
RUN go mod download
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-w -s" -o ./cmd/app/main ./cmd/app/main.go
|
|
|
|
FROM alpine
|
|
|
|
WORKDIR /build
|
|
|
|
COPY --from=builder /build/cmd/app/main /build/cmd/main
|
|
|
|
CMD ["./cmd/main"]
|