Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1596 from duanjie-cmd/feature/goz
Browse files Browse the repository at this point in the history
update  Dockerfile
  • Loading branch information
zhangjinbiao746 authored Nov 2, 2022
2 parents 05f711e + 6164762 commit a7dde46
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions Dockerfile
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/

0 comments on commit a7dde46

Please sign in to comment.