18 lines
349 B
Docker
18 lines
349 B
Docker
|
FROM golang:1.18-alpine AS build_base
|
||
|
WORKDIR /app
|
||
|
|
||
|
RUN apk add git
|
||
|
RUN apk add build-base
|
||
|
|
||
|
COPY go.mod .
|
||
|
COPY go.sum .
|
||
|
RUN go mod download
|
||
|
COPY . .
|
||
|
RUN CGO_ENABLED=1 GOOS=linux go build -o srv ./cmd/srv
|
||
|
|
||
|
FROM alpine:3.9
|
||
|
COPY --from=build_base /app/srv /app/srv
|
||
|
COPY client.secret.json /app
|
||
|
|
||
|
CMD ["/app/srv", "-secret", "/app/client.secret.json"]
|