2019-11-12 04:20:54 +01:00
|
|
|
ARG harbor_base_image_version
|
2020-04-01 13:46:45 +02:00
|
|
|
ARG harbor_base_namespace
|
2023-01-05 03:42:59 +01:00
|
|
|
FROM node:16.18.0 as nodeportal
|
2018-09-04 12:14:40 +02:00
|
|
|
|
2019-08-01 05:37:18 +02:00
|
|
|
WORKDIR /build_dir
|
|
|
|
|
2019-10-10 09:29:50 +02:00
|
|
|
ARG npm_registry=https://registry.npmjs.org
|
|
|
|
|
2019-12-06 04:45:48 +01:00
|
|
|
RUN apt-get update \
|
2021-08-10 03:14:46 +02:00
|
|
|
&& apt-get install -y --no-install-recommends python-yaml
|
2019-12-06 04:45:48 +01:00
|
|
|
|
2019-10-10 09:29:50 +02:00
|
|
|
COPY src/portal/package.json /build_dir
|
|
|
|
COPY src/portal/package-lock.json /build_dir
|
2020-01-15 07:04:59 +01:00
|
|
|
COPY src/portal/scripts /build_dir
|
2020-02-07 08:04:25 +01:00
|
|
|
COPY ./api/v2.0/legacy_swagger.yaml /build_dir/swagger.yaml
|
2020-01-15 07:04:59 +01:00
|
|
|
COPY ./api/v2.0/swagger.yaml /build_dir/swagger2.yaml
|
2020-03-23 07:00:52 +01:00
|
|
|
COPY ./api/swagger.yaml /build_dir/swagger3.yaml
|
2020-01-15 07:04:59 +01:00
|
|
|
|
2019-10-10 09:29:50 +02:00
|
|
|
COPY src/portal /build_dir
|
|
|
|
|
2020-01-15 07:04:59 +01:00
|
|
|
ENV NPM_CONFIG_REGISTRY=${npm_registry}
|
|
|
|
RUN npm install --unsafe-perm
|
2020-05-06 05:23:29 +02:00
|
|
|
RUN npm run generate-build-timestamp
|
2021-06-16 10:39:10 +02:00
|
|
|
RUN node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --configuration production
|
2020-11-11 21:18:02 +01:00
|
|
|
RUN python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger.yaml > dist/swagger.json
|
|
|
|
RUN python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger2.yaml > dist/swagger2.json
|
|
|
|
RUN python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger3.yaml > dist/swagger3.json
|
|
|
|
|
|
|
|
RUN cp swagger.yaml dist
|
|
|
|
COPY ./LICENSE /build_dir/dist
|
2018-09-04 12:14:40 +02:00
|
|
|
|
2022-08-23 06:03:45 +02:00
|
|
|
RUN cd app-swagger-ui && npm install --unsafe-perm
|
|
|
|
RUN cd app-swagger-ui && npm run build
|
|
|
|
|
2020-04-01 13:46:45 +02:00
|
|
|
FROM ${harbor_base_namespace}/harbor-portal-base:${harbor_base_image_version}
|
2018-09-04 12:14:40 +02:00
|
|
|
|
2019-07-22 08:21:28 +02:00
|
|
|
COPY --from=nodeportal /build_dir/dist /usr/share/nginx/html
|
2022-08-23 06:03:45 +02:00
|
|
|
COPY --from=nodeportal /build_dir/app-swagger-ui/dist /usr/share/nginx/html
|
2020-11-11 21:18:02 +01:00
|
|
|
COPY --from=nodeportal /build_dir/package*.json /usr/share/nginx/
|
2019-07-22 08:21:28 +02:00
|
|
|
|
2018-09-04 12:14:40 +02:00
|
|
|
VOLUME /var/cache/nginx /var/log/nginx /run
|
|
|
|
|
|
|
|
STOPSIGNAL SIGQUIT
|
|
|
|
|
2021-05-13 11:16:53 +02:00
|
|
|
HEALTHCHECK CMD curl --fail -s http://localhost:8080 || curl -k --fail -s https://localhost:8443 || exit 1
|
2019-07-30 07:04:28 +02:00
|
|
|
USER nginx
|
2019-07-29 09:52:17 +02:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|
2018-09-04 12:14:40 +02:00
|
|
|
|