forked from tchen0123/supergiant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 904 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 904 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
FROM golang:alpine as builder
COPY . $GOPATH/src/github.com/supergiant/control/
WORKDIR $GOPATH/src/github.com/supergiant/control/
ARG ARCH=amd64
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -a -installsuffix cgo -ldflags='-extldflags "-static" -w -s -X main.version=${TAG}' -o /go/bin/supergiant ./cmd/controlplane
RUN apk --update add ca-certificates
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 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 /go/src/github.com/supergiant/control/templates /etc/supergiant/templates
COPY --from=ui-builder /assets/dist /etc/supergiant/ui
EXPOSE 60200-60250
ENTRYPOINT ["/bin/supergiant", "-ui-dir", "/etc/supergiant/ui"]