From f442b475ad9de7b0d4e688ecfc7c27f176fdd5e4 Mon Sep 17 00:00:00 2001 From: Noah Held <41909795+zuqq@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:40:03 +0000 Subject: [PATCH] Build the Lookout UI in `lookoutv2` (#3085) Signed-off-by: Noah Held --- .goreleaser.yml | 3 +++ build/lookoutv2/Dockerfile | 2 +- build_goreleaser/lookoutv2/Dockerfile | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 9c518298c2e..1e21f2f3b59 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -379,6 +379,9 @@ dockers: - lookoutv2 - lookoutingesterv2 extra_files: + - internal/lookout/ui + - pkg/api/api.swagger.json + - pkg/api/binoculars/api.swagger.json - config/lookoutv2/config.yaml - config/lookoutingesterv2/config.yaml dockerfile: ./build_goreleaser/lookoutv2/Dockerfile diff --git a/build/lookoutv2/Dockerfile b/build/lookoutv2/Dockerfile index 4c789ab2ffd..0d463389398 100644 --- a/build/lookoutv2/Dockerfile +++ b/build/lookoutv2/Dockerfile @@ -5,7 +5,7 @@ RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada USER armada COPY ./lookoutv2 /app/ - +COPY ./internal/lookout/ui/build/ /app/internal/lookout/ui/build COPY ./config/ /app/config/lookoutv2 WORKDIR /app diff --git a/build_goreleaser/lookoutv2/Dockerfile b/build_goreleaser/lookoutv2/Dockerfile index e4dff417504..b3c07af4097 100644 --- a/build_goreleaser/lookoutv2/Dockerfile +++ b/build_goreleaser/lookoutv2/Dockerfile @@ -1,10 +1,27 @@ +ARG NODE_BUILD_IMAGE=node:16.14-buster +ARG OPENAPI_BUILD_IMAGE=openapitools/openapi-generator-cli:v5.4.0 ARG BASE_IMAGE=alpine:3.18.3 + +FROM ${OPENAPI_BUILD_IMAGE} AS OPENAPI + +COPY internal/lookout/ui /project/internal/lookout/ui +COPY pkg/api/*.swagger.json /project/pkg/api/ +COPY pkg/api/binoculars/*.swagger.json /project/pkg/api/binoculars/ +RUN ./project/internal/lookout/ui/openapi.sh + +FROM ${NODE_BUILD_IMAGE} AS NODE +COPY --from=OPENAPI /project/internal/lookout/ui /ui/ +WORKDIR /ui +RUN yarn install --immutable +RUN yarn run build + FROM ${BASE_IMAGE} RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada LABEL org.opencontainers.image.title=lookoutv2 LABEL org.opencontainers.image.description="Lookout V2" LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearchdev/lookoutv2 USER armada +COPY --from=NODE /ui/build/ /app/internal/lookout/ui/build COPY lookoutv2 /app/ COPY config/lookoutv2/config.yaml /app/config/lookoutv2/config.yaml COPY lookoutingesterv2 /app/