diff --git a/.dockerignore b/.dockerignore index dcdd4643..48873b5e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,6 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Contributors to the Egeria project + **/.git **/.github +/node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ef88503b..879fe0a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,41 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Egeria project -FROM public.ecr.aws/nginx/nginx:latest +# Stage 1 - Build +FROM node:16.13.0 AS builder -ARG version=1.4.0 +WORKDIR /app +COPY . /app +RUN npm install +RUN npm run build:docker + +# Stage 2 - Containerize +FROM registry.access.redhat.com/ubi8/nginx-120:1.71 + +ARG version=4.0.2 ARG VCS_REF=unknown ARG VCS_ORIGIN=unknown ARG BUILD_TIME=unknown ARG VCS_DATE=unknown -# Labels from https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys (with additions prefixed ext) LABEL org.opencontainers.image.vendor = "odpi" \ org.opencontainers.image.title = "egeria-ui" \ - org.opencontainers.image.description = "Static Web Content to support the ui server chassis" \ - org.opencontainers.image.url = "https://egeria.odpi.org/" \ + org.opencontainers.image.description = "User interface instance using main Egeria functionalities." \ + org.opencontainers.image.url = "https://egeria-project.org/" \ org.opencontainers.image.source = "$VCS_ORIGIN" \ - org.opencontainers.image.authors = "ODPi Egeria" \ + org.opencontainers.image.authors = "Egeria Contributors" \ org.opencontainers.image.revision = "$VCS_REF" \ org.opencontainers.image.licenses = "Apache-2.0" \ org.opencontainers.image.created = "$BUILD_TIME" \ org.opencontainers.image.version = "$version" \ - org.opencontainers.image.documentation = "https://egeria.odpi.org/open-metadata-resources/open-metadata-deployment/docker/egeria-ui/" \ + org.opencontainers.image.documentation = "" \ org.opencontainers.image.ext.vcs-date = "$VCS_DATE" \ org.opencontainers.image.ext.docker.cmd = "docker run -p 80:80 -d odpi/egeria-ui:latest" \ org.opencontainers.image.ext.docker.debug = "" \ org.opencontainers.image.ext.docker.params = "" -# Just copy the built files & serve via nginx -COPY build/ /var/www/ +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=builder /app/build /var/www/ COPY etc/nginx.conf /etc/nginx/conf.d/default.conf -CMD ["nginx", "-g", "daemon off;"] +ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file