Skip to content

Commit

Permalink
feat: fix web
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Feb 20, 2020
1 parent 265d9ce commit 9de796c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Dockerfile
dist/
vendor/
23 changes: 19 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,32 @@ ARG BUILD_DATE
ARG VCS_REF
ARG VERSION

# build
FROM golang:1.13-alpine as build

# web build
FROM node:10 as web-build
WORKDIR /app
COPY ./web/package*.json ./web/yarn.* ./
RUN npm install
COPY ./web/ ./
RUN npm run build


# go build
FROM golang:1.13-alpine as go-build
RUN apk add --update --no-cache git gcc musl-dev make
RUN GO111MODULE=off go get github.com/gobuffalo/packr/v2/packr2
WORKDIR /go/src/moul.io/depviz
ENV GO111MODULE=on
ENV GO111MODULE=on \
GOPROXY=proxy.golang.org
COPY go.* ./
RUN go mod download
COPY . ./
RUN rm -rf web
COPY --from=web-build /app/dist web
RUN make packr
RUN make install


# minimalist runtime
FROM alpine:3.11
LABEL org.label-schema.build-date=$BUILD_DATE \
Expand All @@ -29,5 +43,6 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.cmd="docker run -i -t --rm moul/depviz" \
org.label-schema.help="docker exec -it $CONTAINER depviz --help"
RUN apk add --update --no-cache ca-certificates
COPY --from=build /go/bin/depviz /bin/
COPY --from=go-build /go/bin/depviz /bin/
ENTRYPOINT ["depviz"]
EXPOSE 8000 9000
4 changes: 4 additions & 0 deletions web/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NODE_ENV=development
__DEV__=true
#API_URL=http://localhost:8000/api
API_URL=/api
3 changes: 2 additions & 1 deletion web/.env.prod
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NODE_ENV=production
__DEV__=false
API_URL=https://depviz-demo.moul.io/api
#API_URL=https://depviz-demo.moul.io/api
API_URL=/api

0 comments on commit 9de796c

Please sign in to comment.