-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM golang:latest AS api | ||
|
||
ENV GO111MODULE=on \ | ||
CGO_ENABLED=1 | ||
|
||
WORKDIR /build | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go build -trimpath -o vxconnect . | ||
|
||
WORKDIR /dist | ||
RUN cp /build/vxconnect ./vxconnect | ||
|
||
RUN ldd vxconnect | tr -s '[:blank:]' '\n' | grep '^/' | \ | ||
xargs -I % sh -c 'mkdir -p $(dirname ./%); cp % ./%;' | ||
RUN mkdir -p lib64 && cp /lib64/ld-linux-x86-64.so.2 lib64/ | ||
|
||
FROM node:latest as react | ||
RUN apt-get update && apt-get install -y glib2.0-dev libvips-dev | ||
WORKDIR /build | ||
COPY ./ui . | ||
RUN yarn | ||
RUN yarn run build | ||
|
||
FROM alpine:latest | ||
COPY --chown=0:0 --from=api /dist / | ||
COPY --chown=0:0 --from=react /build/dist /dist | ||
USER 0 | ||
|
||
ENTRYPOINT ["/vxconnect"] | ||
EXPOSE 8080 |