summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 75010474563c13491c742fe4bfe866a7daeb0612 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 ./static
COPY tpl ./tpl
CMD ["/usr/app/service"]