-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (26 loc) · 977 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (26 loc) · 977 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
## bundle web assets
FROM node:6.7.0 as webpack-bundle
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
ENV GOPATH /go
ENV PACKAGE github.com/runconduit/conduit/web/app
ENV PACKAGEDIR $GOPATH/src/$PACKAGE
COPY web/app $PACKAGEDIR
WORKDIR $PACKAGEDIR
# node dependencies
RUN $HOME/.yarn/bin/yarn install --pure-lockfile
# frontend assets
RUN $HOME/.yarn/bin/yarn webpack
## compile go server
FROM gcr.io/runconduit/go-deps:dac3fae6 as golang
ARG CONDUIT_VERSION
WORKDIR /go/src/github.com/runconduit/conduit
COPY web web
COPY controller controller
COPY pkg pkg
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o web/web -ldflags "-X github.com/runconduit/conduit/pkg/version.Version=$CONDUIT_VERSION" ./web
## package it all up
FROM gcr.io/runconduit/base:2017-10-30.01
COPY --from=golang /go/src/github.com/runconduit/conduit/web .
RUN mkdir -p ./dist
COPY --from=webpack-bundle /go/src/github.com/runconduit/conduit/web/app/dist ./dist
ENTRYPOINT ["./web"]