From 5a168928ea451010b97d06be686b1a1a2141b31d Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Mon, 2 May 2022 14:09:37 +0300 Subject: Dockerfile --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..efa35cb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +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 . +COPY static . +COPY tpl . +CMD ["./service"] -- cgit v1.2.3