2019-03-27 03:47:07 +01:00
|
|
|
FROM node:10.15.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
|
|
|
|
ENV NPM_CONFIG_REGISTRY=${npm_registry}
|
|
|
|
|
|
|
|
COPY src/portal/package.json /build_dir
|
|
|
|
COPY src/portal/package-lock.json /build_dir
|
2019-10-29 12:02:33 +01:00
|
|
|
COPY ./API/harbor/swagger.yaml /build_dir
|
2019-09-05 09:13:13 +02:00
|
|
|
|
2019-10-10 09:29:50 +02:00
|
|
|
RUN apt-get update \
|
2019-08-01 10:02:08 +02:00
|
|
|
&& apt-get install -y --no-install-recommends python-yaml=3.12-1 \
|
|
|
|
&& python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger.yaml > swagger.json \
|
2019-10-10 09:29:50 +02:00
|
|
|
&& npm install
|
|
|
|
|
|
|
|
COPY ./LICENSE /build_dir
|
|
|
|
COPY src/portal /build_dir
|
|
|
|
|
|
|
|
RUN ls -la \
|
2019-08-01 05:37:18 +02:00
|
|
|
&& npm run build_lib \
|
|
|
|
&& npm run link_lib \
|
2019-11-06 09:37:21 +01:00
|
|
|
&& node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
|
2018-09-04 12:14:40 +02:00
|
|
|
|
|
|
|
|
2018-10-18 05:03:28 +02:00
|
|
|
FROM photon:2.0
|
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
|
|
|
|
COPY --from=nodeportal /build_dir/swagger.yaml /usr/share/nginx/html
|
|
|
|
COPY --from=nodeportal /build_dir/swagger.json /usr/share/nginx/html
|
2019-08-05 08:20:03 +02:00
|
|
|
COPY --from=nodeportal /build_dir/LICENSE /usr/share/nginx/html
|
2019-07-22 08:21:28 +02:00
|
|
|
|
|
|
|
COPY make/photon/portal/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
2019-07-30 07:04:28 +02:00
|
|
|
RUN tdnf install -y nginx sudo >> /dev/null \
|
2018-09-04 12:14:40 +02:00
|
|
|
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
|
|
|
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
2019-07-30 07:04:28 +02:00
|
|
|
&& groupadd -r -g 10000 nginx && useradd --no-log-init -r -g 10000 -u 10000 nginx \
|
|
|
|
&& chown -R nginx:nginx /etc/nginx \
|
|
|
|
&& tdnf clean all
|
2018-09-04 12:14:40 +02:00
|
|
|
|
2019-08-01 10:02:08 +02:00
|
|
|
EXPOSE 8080
|
2018-09-04 12:14:40 +02:00
|
|
|
VOLUME /var/cache/nginx /var/log/nginx /run
|
|
|
|
|
|
|
|
STOPSIGNAL SIGQUIT
|
|
|
|
|
2019-07-22 08:21:28 +02:00
|
|
|
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:8080 || 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
|
|
|
|