password moved from hard coded values to environment properties
[portal.git] / deliveries / Dockerfile.portal
index a2a143c..f12a3e3 100644 (file)
@@ -1,10 +1,8 @@
 # Dockerfile for image with ONAP Portal
+ARG BE_BASE_IMAGE=tomcat:8.5.35-jre8-alpine
+FROM ${BE_BASE_IMAGE}
 
-# Yields an image 823 MB
-FROM frolvlad/alpine-oraclejdk8:slim
-# Yields an image 1.4 GB
-# FROM openjdk:8-jdk
-
+RUN apk add sudo && echo "portal ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
 # Arguments are supplied by build.sh script
 # the defaults below only support testing
 ARG PORTAL_WAR=build/ecompportal-be-os.war
@@ -14,26 +12,24 @@ ARG HTTPS_PROXY
 # ARG PORTAL_CERT=truststoreONAPall.jks
 
 # Just variables, never passed in
-ARG TOMCAT=apache-tomcat-8.0.37
-ARG TOMCATTAR=${TOMCAT}.tar.gz
-ARG TOMCATHOME=/opt/${TOMCAT}
 ARG PORTALCONTEXT=ONAPPORTAL
 
+ARG TOMCAT=/usr/local/tomcat
+ARG TOMCATHOME=${TOMCAT}
+ARG SERVERXML=${SERVERXML}
+
 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}
+
+RUN if [ -d /etc/apt ] && [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
+    if [ -d /etc/apt ] && [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
+
 # Remove manager and sample apps
-RUN rm -fr ${TOMCAT}/webapps/*
+RUN rm -rf ${TOMCAT}/webapps/[a-z]*
 RUN mkdir -p /opt
 COPY ${SERVERXML} ${TOMCAT}/conf
-RUN mv ${TOMCAT} /opt
+# TODO: ????
+#RUN mv ${TOMCAT} /opt
 
 WORKDIR ${TOMCATHOME}/webapps
 RUN mkdir ${PORTALCONTEXT}
@@ -54,4 +50,5 @@ ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
 COPY start-apache-tomcat.sh /
 
 # Define default command
-CMD /start-apache-tomcat.sh
+ENV TOMCATHOME=$TOMCATHOME
+CMD /start-apache-tomcat.sh -b $TOMCATHOME