forked from gochain/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 873 Bytes
/
Dockerfile
File metadata and controls
29 lines (25 loc) · 873 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
# Build GoChain in a stock Go builder container
FROM golang:1.13-alpine as backend_builder
RUN apk --no-cache add build-base git bzr mercurial gcc linux-headers g++ make
ENV D=/explorer
WORKDIR $D
# cache dependencies
ADD go.mod $D
ADD go.sum $D
RUN go mod download
ADD . $D
# build
RUN cd $D && make backend && mkdir -p /tmp/gochain && cp $D/server/server /tmp/gochain/ && cp $D/grabber/grabber /tmp/gochain/ && cp $D/admin/admin /tmp/gochain/
FROM node:10-alpine as frontend_builder
WORKDIR /explorer
RUN apk add --no-cache make git gcc g++ python
ADD . /explorer
RUN npm install -g @angular/cli
RUN make frontend
FROM alpine:latest
WORKDIR /explorer
RUN apk add --no-cache ca-certificates docker
COPY --from=backend_builder /tmp/gochain/* /usr/local/bin/
COPY --from=frontend_builder /explorer/front/dist/* /explorer/
EXPOSE 8080
CMD [ "server","-d", "/explorer/" ]