forked from headlamp-k8s/headlamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (20 loc) · 761 Bytes
/
Dockerfile
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
ARG IMAGE_BASE=alpine:3.11.3
FROM $IMAGE_BASE as base-build
ENV GOPATH=/go \
GOPROXY=https://proxy.golang.org \
GO111MODULE=on
RUN apk update && \
apk add git nodejs npm go ca-certificates make musl-dev bash
COPY ./ /headlamp/
WORKDIR /headlamp
RUN cd ./backend && go build -o ./server ./cmd/
RUN cd ./frontend && npm install && npm run build
# Create a plugins folder if none exists so we copy whatever exists to the
# image.
RUN mkdir -p ./plugins
FROM $IMAGE_BASE
COPY --from=base-build /headlamp/backend/server /headlamp/server
COPY --from=base-build /headlamp/frontend/build /headlamp/frontend
COPY --from=base-build /headlamp/plugins /headlamp/plugins
EXPOSE 4466
ENTRYPOINT ["/headlamp/server", "-html-static-dir", "/headlamp/frontend"]