2022-05-02 14:09:37 +03:00
|
|
|
FROM golang:1.18 as builder
|
|
|
|
WORKDIR /usr/src
|
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN go build -a -installsuffix cgo -o service .
|
|
|
|
|
|
|
|
FROM alpine
|
|
|
|
RUN apk update \
|
|
|
|
&& apk upgrade \
|
|
|
|
&& apk add --no-cache \
|
|
|
|
ca-certificates \
|
|
|
|
&& update-ca-certificates 2>/dev/null || true
|
|
|
|
WORKDIR /usr/app
|
|
|
|
COPY --from=builder /usr/src/service .
|
2022-05-02 14:19:30 +03:00
|
|
|
COPY static ./static
|
|
|
|
COPY tpl ./tpl
|
|
|
|
CMD ["/usr/app/service"]
|