tom@9684: # Docker file for D4E River GWT client tom@9684: tom@9795: FROM centos:7 AS base tom@9684: MAINTAINER tom@intevation.de tom@9684: tom@9715: # Necessary to run further yum-installs inside Docker container, tom@9715: # if not already part of the base image: tom@9732: RUN yum -q -y install yum-plugin-ovl && rpm --rebuilddb tom@9715: tom@9795: FROM base AS build tom@9684: # Install prerequisites tom@9795: RUN yum -q -y install maven mercurial curl tom@9787: tom@9684: WORKDIR /opt/d4e tom@9776: ENV REPO_URL https://hg.wald.intevation.org/dive4elements/ tom@9684: ENV BRANCH 3.2.x tom@9684: RUN hg clone -b $BRANCH $REPO_URL/framework tom@9684: RUN hg clone -b $BRANCH $REPO_URL/http-client tom@9684: tom@9684: RUN mvn -q -f framework/pom.xml install tom@9684: RUN mvn -q -f http-client/pom.xml install tom@9684: tom@9741: RUN curl -sLO "https://github.com/openlayers/ol2/releases/download/release-2.11/OpenLayers-2.11.tar.gz" tom@9685: tom@9684: # Use latest patch release and fake version=4.1-p20141119 to work around tom@9684: # the actual version (which is known to work properly) tom@9684: # is not publicly available tom@9741: RUN curl -sLO https://www.smartclient.com/builds/SmartGWT/4.1p/LGPL/latest/smartgwt.jar tom@9741: RUN mvn -q install:install-file -Dfile=smartgwt.jar -Dversion=4.1-p20141119 \ tom@9741: -DartifactId=smartgwt-lgpl -DgroupId=com.isomorphic.smartgwt.lgpl \ tom@9741: -Dpackaging=jar tom@9684: tom@9781: # Download dependencies before adding sources to leverage build cache tom@9781: ADD gwt-client/pom.xml river/gwt-client/ tom@9781: RUN mvn -q -f river/gwt-client/pom.xml dependency:go-offline tom@9781: tom@9780: ADD checkstyle.xml river/ tom@9780: ADD gwt-client river/gwt-client/ tom@9684: tom@9685: RUN tar -C river/gwt-client/src/main/webapp \ tom@9685: --exclude=OpenLayers-2.11/doc --exclude=OpenLayers-2.11/tests \ tom@9685: --exclude=OpenLayers-2.11/examples -xf OpenLayers-2.11.tar.gz tom@9685: RUN rm OpenLayers-2.11.tar.gz tom@9781: tom@9795: RUN mvn -q -f river/gwt-client/pom.xml package tom@9795: tom@9795: FROM base tom@9795: RUN yum -q -y install tomcat gnu-free-sans-fonts tom@9795: tom@9796: RUN localedef -i en_US -f UTF-8 en_US.UTF-8 tom@9796: RUN echo "LANG=en_US.utf8" > /etc/locale.conf tom@9796: ENV LANG en_US.utf8 tom@9796: tom@9795: # Prevent Tomcat from logging to files tom@9795: # (JRE default is logging to System.err) tom@9795: RUN rm /etc/tomcat/logging.properties tom@9684: tom@9743: # Configure tomcat tom@9743: RUN sed -i '/Connector port="8080"/a \URIEncoding="UTF-8"' /etc/tomcat/server.xml tom@9797: RUN sed -i 's/\(Connector port="8009"\)/\1 URIEncoding="UTF-8"/' \ tom@9797: /etc/tomcat/server.xml tom@9798: ENV CONFIG_DIR /opt/d4e/river/gwt-client/config tom@9798: ADD gwt-client/config $CONFIG_DIR tom@9798: RUN ln -sf $CONFIG_DIR/context.xml /etc/tomcat tom@9798: VOLUME $CONFIG_DIR tom@9743: tom@9795: # Deploy tom@9795: COPY --from=build /opt/d4e/river/gwt-client/target/gwt-client-*.war \ tom@9795: /usr/share/tomcat/webapps/d4e-river.war tom@9795: tom@9742: USER tomcat tom@9742: ADD docker/flys_user_file /usr/share/tomcat/ tom@9684: tom@9684: CMD ["/usr/libexec/tomcat/server", "start"]