From 5d55c4181f7037f158b3aa0e25e915b953e7b3c0 Mon Sep 17 00:00:00 2001 From: Chandan Ghosh Date: Tue, 9 Apr 2019 15:18:05 +0530 Subject: Added required docker file to deploy as container Added required docker file to deploy as container Issue-ID: CCSDK-1209 Change-Id: Ib455cfee95f58ca759eefa6d06469d164930e3a3 Signed-off-by: Chandan Ghosh --- .gitignore | 1 + cds-ui/server/.dockerignore | 4 +++ cds-ui/server/Dockerfile | 28 ++++++++++++++++++ cds-ui/server/pom.xml | 69 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 cds-ui/server/.dockerignore create mode 100644 cds-ui/server/Dockerfile diff --git a/.gitignore b/.gitignore index 5dbd1d403..e3e0e1f22 100644 --- a/.gitignore +++ b/.gitignore @@ -144,3 +144,4 @@ MacOS # To Remove Kotlin Script Generated Jars **/*cba-kts.jar +/target/ diff --git a/cds-ui/server/.dockerignore b/cds-ui/server/.dockerignore new file mode 100644 index 000000000..3b3ee0060 --- /dev/null +++ b/cds-ui/server/.dockerignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log +/dist + diff --git a/cds-ui/server/Dockerfile b/cds-ui/server/Dockerfile new file mode 100644 index 000000000..bca90e201 --- /dev/null +++ b/cds-ui/server/Dockerfile @@ -0,0 +1,28 @@ +# Check out https://hub.docker.com/_/node to select a new base image +FROM node:10-slim + +# Set to a non-root built-in user `node` +USER node + +# Create app directory (with user `node`) +RUN mkdir -p /home/node/app + +WORKDIR /home/node/app + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY --chown=node package*.json ./ + +RUN npm install + +# Bundle app source code +COPY --chown=node . . + +RUN npm run build + +# Bind to all network interfaces so that it can be mapped to the host OS +ENV HOST=0.0.0.0 PORT=3000 + +EXPOSE ${PORT} +CMD [ "node", "." ] diff --git a/cds-ui/server/pom.xml b/cds-ui/server/pom.xml index 59b14b890..1c05d5521 100644 --- a/cds-ui/server/pom.xml +++ b/cds-ui/server/pom.xml @@ -39,6 +39,8 @@ limitations under the License. UTF-8 npm https://nexus.onap.org + onap/ccsdk-cds-ui-server + deploy @@ -91,6 +93,73 @@ limitations under the License. + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + validate + + execute + + + ${basedir}/../../TagVersion.groovy + + + + + + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.26.1 + false + + + + ${image.name} + + try + ${basedir} + + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} + + + + + true + + + + generate-images + package + + build + + + + push-images + ${docker.push.phase} + + build + push + + + + + + + + + -- cgit 1.2.3-korg