This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1596 from duanjie-cmd/feature/goz
update Dockerfile
- Loading branch information
Showing
1 changed file
with
7 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
FROM node:10.4.1-alpine as builder | ||
FROM node:10-alpine as builder | ||
WORKDIR /app | ||
COPY ./frontend /app | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \ | ||
apk add make git && npm config set registry https://registry.npm.taobao.org && \ | ||
npm install && npm run build | ||
|
||
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 | ||
|
||
RUN mkdir -p GOPATH REPO_PATH | ||
|
||
COPY ./backend/ $REPO_PATH | ||
WORKDIR $REPO_PATH | ||
|
||
RUN apk add --no-cache make git && go get github.com/golang/dep/cmd/dep && dep ensure && 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 | ||
FROM nginx:1.15-alpine | ||
COPY --from=builder /app/dist/ /usr/share/nginx/html/ |