forked from tchen0123/supergiant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 928 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 928 Bytes
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
27
28
29
30
31
32
FROM node:11.3.0-alpine as ui-builder
COPY ./cmd/ui/ /
WORKDIR /assets
RUN npm rebuild node-sass
RUN npm install
RUN npm run build
FROM golang:1.12.6 as builder
COPY --from=ui-builder /assets/dist /etc/supergiant/ui
COPY . $GOPATH/src/github.com/supergiant/control/
WORKDIR $GOPATH/src/github.com/supergiant/control/
ARG ARCH=amd64
ARG TAG=unstable
RUN go get -u github.com/rakyll/statik
RUN statik -src=/etc/supergiant/ui
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -mod=vendor -a -ldflags="-X main.version=${TAG}" -o /go/bin/supergiant ./cmd/controlplane
RUN mkdir -p /data
RUN update-ca-certificates
FROM scratch as prod
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /go/bin/supergiant /bin/supergiant
COPY --from=builder /data /data
EXPOSE 60200-60250
ENTRYPOINT ["/bin/supergiant", "-storage-uri", "/data/supergiant.db"]