blob: f12a3e30e4fdba4256b0288e7e7298db73b990ee [file] [log] [blame]
st782s21a87612018-01-30 17:29:36 -05001# Dockerfile for image with ONAP Portal
stattae10ac252019-09-09 11:58:00 -04002ARG BE_BASE_IMAGE=tomcat:8.5.35-jre8-alpine
3FROM ${BE_BASE_IMAGE}
st782s21a87612018-01-30 17:29:36 -05004
stattae10ac252019-09-09 11:58:00 -04005RUN apk add sudo && echo "portal ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
st782s21a87612018-01-30 17:29:36 -05006# Arguments are supplied by build.sh script
7# the defaults below only support testing
8ARG PORTAL_WAR=build/ecompportal-be-os.war
9ARG FE_DIR=build/public
10ARG HTTP_PROXY
11ARG HTTPS_PROXY
Kishore Reddy, Gujja (kg811t)a59bc3e2018-09-25 13:59:56 -040012# ARG PORTAL_CERT=truststoreONAPall.jks
st782s21a87612018-01-30 17:29:36 -050013
14# Just variables, never passed in
st782s21a87612018-01-30 17:29:36 -050015ARG PORTALCONTEXT=ONAPPORTAL
16
stattae10ac252019-09-09 11:58:00 -040017ARG TOMCAT=/usr/local/tomcat
18ARG TOMCATHOME=${TOMCAT}
19ARG SERVERXML=${SERVERXML}
20
st782s21a87612018-01-30 17:29:36 -050021ENV http_proxy $HTTP_PROXY
22ENV https_proxy $HTTPS_PROXY
st782s21a87612018-01-30 17:29:36 -050023
stattae10ac252019-09-09 11:58:00 -040024RUN if [ -d /etc/apt ] && [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
25 if [ -d /etc/apt ] && [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
st782s21a87612018-01-30 17:29:36 -050026
stattae10ac252019-09-09 11:58:00 -040027# Remove manager and sample apps
28RUN rm -rf ${TOMCAT}/webapps/[a-z]*
29RUN mkdir -p /opt
30COPY ${SERVERXML} ${TOMCAT}/conf
31# TODO: ????
32#RUN mv ${TOMCAT} /opt
33
34WORKDIR ${TOMCATHOME}/webapps
35RUN mkdir ${PORTALCONTEXT}
36
37# Portal has many parts
38COPY $PORTAL_WAR ${PORTALCONTEXT}
39RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
40COPY ${FE_DIR} ${PORTALCONTEXT}/public
st782s21a87612018-01-30 17:29:36 -050041
42VOLUME ${TOMCATHOME}/logs
43
44# Switch back to root
45WORKDIR /
46
47# Define commonly used ENV variables
48ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
49# Install the launch script
50COPY start-apache-tomcat.sh /
51
52# Define default command
stattae10ac252019-09-09 11:58:00 -040053ENV TOMCATHOME=$TOMCATHOME
54CMD /start-apache-tomcat.sh -b $TOMCATHOME