forked from irisnet/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (22 loc) · 805 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
FROM node:10.4.1-alpine as builder
WORKDIR /app
RUN npm i yarn -g
RUN apk add --no-cache git
COPY ./frontend/ /app
RUN npm i cnpm -g && cnpm install && yarn build
FROM golang:1.10.3-alpine3.7 as go-builder
ENV GOPATH /root/go
ENV REPO_PATH $GOPATH/src/github.com/irisnet/explorer/backend
ENV PATH $GOPATH/bin:$PATH
ENV GO111MODULE on
RUN mkdir -p $GOPATH $REPO_PATH
COPY ./backend/ $REPO_PATH
WORKDIR $REPO_PATH
RUN apk add --no-cache make git && make build
FROM alpine:3.7
ENV TZ Asia/Shanghai
RUN apk add -U tzdata && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /app/backend
COPY --from=builder /app/dist/ /app/frontend/dist
COPY --from=go-builder /root/go/src/github.com/irisnet/explorer/backend/build/ /app/backend/
CMD ./irisplorer