From 92bc2f4964e1930c00bcb0ff2e23013b06de9327 Mon Sep 17 00:00:00 2001 From: Petr OspalĂ˝ Date: Fri, 7 Jun 2019 18:30:36 +0200 Subject: Fix admportal image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker container should be stateless and be self-contained. When image is run as container it should behave exactly the same with each run. This commit moves npm install stuff into docker build stage where it belongs. Please, read: https://docs.docker.com/get-started/part2/ Issue-ID: SDNC-685 Signed-off-by: Petr OspalĂ˝ Change-Id: I4ff18b313a9af400bbfc2cbf6f4a1b1334593d9a Former-commit-id: 8436b953a938452f2d7c865e3bc2449ecfcabdea --- admportal/shell/start_portal.sh | 5 +++-- installation/admportal/src/main/docker/Dockerfile | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/admportal/shell/start_portal.sh b/admportal/shell/start_portal.sh index 8a0c4452..36716f47 100755 --- a/admportal/shell/start_portal.sh +++ b/admportal/shell/start_portal.sh @@ -20,11 +20,12 @@ SSL_ENABLED=`python $PROJECT_HOME/admportal/shell/getAdmPortalProp.py sslEnabled export SSL_ENABLED if [ ! -d /opt/onap/sdnc/admportal/node_modules ]; then - cd /opt/onap/sdnc/admportal && npm install + echo "ERROR: missing node modules: /opt/onap/sdnc/admportal/node_modules" + exit 1 fi cd /opt/onap/sdnc/admportal -node shell/www +exec node shell/www #if [ "true" == "${SSL_ENABLED}" ]; then #pm2 startOrRestart process.https.json #else diff --git a/installation/admportal/src/main/docker/Dockerfile b/installation/admportal/src/main/docker/Dockerfile index 21cd7a30..f5b51d1f 100644 --- a/installation/admportal/src/main/docker/Dockerfile +++ b/installation/admportal/src/main/docker/Dockerfile @@ -8,5 +8,7 @@ MAINTAINER SDN-C Team (sdnc@lists.openecomp.org) # copy openecomp COPY opt /opt +RUN cd /opt/onap/sdnc/admportal && npm install + #ENTRYPOINT exec /opt/openecomp/sdnc/admportal/shell/startssl.sh EXPOSE 8843 8443 -- cgit 1.2.3-korg