summaryrefslogtreecommitdiffstats
path: root/deliveries/Dockerfile.portal
diff options
context:
space:
mode:
Diffstat (limited to 'deliveries/Dockerfile.portal')
-rw-r--r--deliveries/Dockerfile.portal55
1 files changed, 55 insertions, 0 deletions
diff --git a/deliveries/Dockerfile.portal b/deliveries/Dockerfile.portal
new file mode 100644
index 00000000..81eeb655
--- /dev/null
+++ b/deliveries/Dockerfile.portal
@@ -0,0 +1,55 @@
+# Dockerfile for image with ONAP Portal
+
+# Yields an image 823 MB
+FROM frolvlad/alpine-oraclejdk8:slim
+# Yields an image 1.4 GB
+# FROM openjdk:8-jdk
+
+# Arguments are supplied by build.sh script
+# the defaults below only support testing
+ARG PORTAL_WAR=build/ecompportal-be-os.war
+ARG FE_DIR=build/public
+ARG HTTP_PROXY
+ARG HTTPS_PROXY
+
+# Just variables, never passed in
+ARG TOMCAT=apache-tomcat-8.0.37
+ARG TOMCATTAR=${TOMCAT}.tar.gz
+ARG TOMCATHOME=/opt/${TOMCAT}
+ARG PORTALCONTEXT=ONAPPORTAL
+
+ENV http_proxy $HTTP_PROXY
+ENV https_proxy $HTTPS_PROXY
+RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
+ if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
+
+# Install Tomcat. This image already has curl.
+WORKDIR /tmp
+RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
+RUN tar -xzf ${TOMCATTAR}
+RUN rm ${TOMCATTAR}
+# Remove manager and sample apps
+RUN rm -fr ${TOMCAT}/webapps/[a-z]*
+RUN mkdir -p /opt
+RUN mv ${TOMCAT} /opt
+
+WORKDIR ${TOMCATHOME}/webapps
+RUN mkdir ${PORTALCONTEXT}
+
+# Portal has many parts
+COPY $PORTAL_WAR ${PORTALCONTEXT}
+RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
+COPY ${FE_DIR} ${PORTALCONTEXT}/public
+
+VOLUME ${TOMCATHOME}/logs
+
+# Switch back to root
+WORKDIR /
+
+# Define commonly used ENV variables
+ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
+# Install the launch script
+COPY start-apache-tomcat.sh /
+
+# Define default command
+CMD /start-apache-tomcat.sh