From 40ee89ac1d1a8c116d96146a8f6ba862bc81db26 Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Tue, 11 Feb 2020 11:50:07 -0500 Subject: Change health check to run as non-root user Requires change to listening port for health check server (from 80 to 8080). Also update nodejs version. Issue-ID: DCAEGEN2-2071 Signed-off-by: Jack Lucas Change-Id: I5e85cc2184cfab845a70905edabad4699f0ef411 --- healthcheck-container/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'healthcheck-container/Dockerfile') diff --git a/healthcheck-container/Dockerfile b/healthcheck-container/Dockerfile index ac61e1b..9b884a7 100644 --- a/healthcheck-container/Dockerfile +++ b/healthcheck-container/Dockerfile @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ -# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,10 +16,13 @@ # limitations under the License. # ============LICENSE_END========================================================= # -FROM node:10.14.1 -RUN mkdir -p /opt/app +FROM node:12.15.0 +RUN mkdir -p /opt/app \ + && useradd -d /opt/app health COPY *.js /opt/app/ COPY package.json /opt/app/ +RUN chown -R health:health /opt/app WORKDIR /opt/app -EXPOSE 80 +USER health +EXPOSE 8080 ENTRYPOINT ["/usr/local/bin/node", "healthcheck.js"] -- cgit 1.2.3-korg