forked from moira-alert/moira
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.api
26 lines (17 loc) · 861 Bytes
/
Dockerfile.api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM golang:1.11.2 as builder
WORKDIR /go/src/github.com/moira-alert/moira
COPY . /go/src/github.com/moira-alert/moira/
RUN go get github.com/kardianos/govendor
RUN govendor sync
ARG GO_VERSION="GoVersion"
ARG GIT_COMMIT="git_Commit"
ARG MoiraVersion="MoiraVersion"
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-X main.MoiraVersion=${MoiraVersion} -X main.GoVersion=${GO_VERSION} -X main.GitCommit=${GIT_COMMIT}" -o build/api github.com/moira-alert/moira/cmd/api
FROM alpine
RUN apk add --no-cache ca-certificates && update-ca-certificates
COPY pkg/api/api.yml /etc/moira/api.yml
COPY pkg/api/web.json /etc/moira/web.json
COPY --from=builder /go/src/github.com/moira-alert/moira/build/api /usr/bin/api
COPY --from=builder /usr/local/go/lib/time/zoneinfo.zip /usr/local/go/lib/time/
EXPOSE 8081 8081
ENTRYPOINT ["/usr/bin/api"]