comparison docker/Dockerfile.artifacts @ 9731:1dfcbb09c231 3.2.x

Improve server deployment in Docker container _ Compile during build instead of with CMD _ No longer run service as root user
author Tom Gottfried <tom@intevation.de>
date Fri, 15 Jul 2022 16:24:56 +0200
parents 0a5239a1e46e
children a6c6bba0fc4b
comparison
equal deleted inserted replaced
9730:7f8110eed9a3 9731:1dfcbb09c231
16 RUN mkdir -p $DEM_DIR 16 RUN mkdir -p $DEM_DIR
17 RUN curl -s "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \ 17 RUN curl -s "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
18 tar -C $DEM_DIR --strip-components=1 --wildcards -xz 'demodaten/dem*.grd' 18 tar -C $DEM_DIR --strip-components=1 --wildcards -xz 'demodaten/dem*.grd'
19 19
20 20
21 WORKDIR /opt/d4e 21 WORKDIR /opt/d4e/src
22 ENV REPO_URL https://scm.wald.intevation.org/hg/dive4elements/ 22 ENV REPO_URL https://scm.wald.intevation.org/hg/dive4elements/
23 ENV BRANCH 3.2.x 23 ENV BRANCH 3.2.x
24 RUN hg clone -b $BRANCH $REPO_URL/framework 24 RUN hg clone -b $BRANCH $REPO_URL/framework
25 RUN hg clone -b $BRANCH $REPO_URL/http-client 25 RUN hg clone -b $BRANCH $REPO_URL/http-client
26 26
36 # Install WSPLGEN 36 # Install WSPLGEN
37 ENV WSPLGEN_URL https://wald.intevation.org/frs/download.php/1496/wsplgen-linux-64bit-static.gz 37 ENV WSPLGEN_URL https://wald.intevation.org/frs/download.php/1496/wsplgen-linux-64bit-static.gz
38 RUN curl -s $WSPLGEN_URL | gunzip > bin/wsplgen && chmod +x bin/wsplgen 38 RUN curl -s $WSPLGEN_URL | gunzip > bin/wsplgen && chmod +x bin/wsplgen
39 39
40 # Create h2 databases 40 # Create h2 databases
41 RUN ../../framework/artifact-database/bin/createArtifacts.sh && \ 41 RUN ../../framework/artifact-database/bin/createArtifacts.sh
42 mv artifactsdb doc/ 42 RUN ./bin/createDatacage.sh
43 RUN ./bin/createDatacage.sh && \ 43
44 mv datacagedb doc/ 44 RUN mvn -q package assembly:single
45 45
46 EXPOSE 8181 46 EXPOSE 8181
47 47
48 CMD mvn -Dexec.mainClass=org.dive4elements.artifactdatabase.App \ 48 WORKDIR /opt/d4e/bin
49 -Dlog4j2.configurationFile="file:///opt/d4e/river/artifacts/doc/conf/log4j2.xml" \ 49 RUN useradd d4e
50 -Dartifact.database.dir="/opt/d4e/river/artifacts/doc/conf" \ 50 RUN chown d4e:d4e .
51 -Dwsplgen.bin.path="/opt/d4e/river/artifacts/bin/wsplgen" \ 51 USER d4e
52 compile exec:java 52
53 RUN tar -xf ../src/river/artifacts/target/river-artifacts-1.0-SNAPSHOT-bin.tar
54
55 CMD bin/run.sh

http://dive4elements.wald.intevation.org