tom@9684: # Docker file for D4E River artifact server tom@9684: tom@9684: FROM centos:7 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@9684: # Install prerequisites tom@9732: RUN yum -q -y install maven mercurial curl tom@9716: tom@9716: # Add DEMs from demo dataset tom@9716: ENV DEM_DIR /opt/d4e-river/dgm tom@9716: ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz tom@9716: RUN mkdir -p $DEM_DIR tom@9716: RUN curl -s "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \ tom@9716: tar -C $DEM_DIR --strip-components=1 --wildcards -xz 'demodaten/dem*.grd' tom@9716: tom@9764: # Volume for DEM data tom@9764: VOLUME $DEM_DIR tom@9764: tom@9684: tom@9731: WORKDIR /opt/d4e/src 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@9733: RUN mvn -q -DskipTests -f framework/pom.xml install tom@9733: RUN mvn -q -DskipTests -f http-client/pom.xml install tom@9684: tom@9779: # If ORACLE=true, the oracle profile in the POM is activated tom@9779: ARG ORACLE tom@9782: ADD ./backend river/backend tom@9782: ADD checkstyle.xml river/ tom@9733: RUN mvn -q -DskipTests -f river/backend/pom.xml install tom@9684: tom@9782: # Download dependencies before adding sources to leverage build cache tom@9782: ADD artifacts/pom.xml river/artifacts/ tom@9782: RUN mvn -q -f river/artifacts/pom.xml dependency:go-offline tom@9782: ADD ./artifacts river/artifacts tom@9782: tom@9684: WORKDIR river/artifacts tom@9716: tom@9716: # Install WSPLGEN tom@9716: ENV WSPLGEN_URL https://wald.intevation.org/frs/download.php/1496/wsplgen-linux-64bit-static.gz tom@9716: RUN curl -s $WSPLGEN_URL | gunzip > bin/wsplgen && chmod +x bin/wsplgen tom@9716: tom@9716: # Create h2 databases tom@9777: RUN sh ../../framework/artifact-database/bin/createArtifacts.sh tom@9777: RUN sh ./bin/createDatacage.sh tom@9731: tom@9733: RUN mvn -q -DskipTests package assembly:single tom@9684: tom@9731: WORKDIR /opt/d4e/bin tom@9731: RUN useradd d4e tom@9731: RUN chown d4e:d4e . tom@9731: USER d4e tom@9731: tom@9731: RUN tar -xf ../src/river/artifacts/target/river-artifacts-1.0-SNAPSHOT-bin.tar tom@9731: tom@9777: CMD sh bin/run.sh