[PATCH 2 of 3] Improve Docker-based development setup
Wald Commits
scm-commit at wald.intevation.org
Mon Mar 22 18:16:27 CET 2021
# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1616430930 -3600
# Mon Mar 22 17:35:30 2021 +0100
# Branch 3.2.x
# Node ID c3afc0274bba82e121dbf9aab377fbbf1593ff4f
# Parent 278d285a16bf458f4cc5e754542507e12e95daf4
Improve Docker-based development setup
_ Add demo DEMs and WSPLGEN to artifact server
_ Do not unpack unused large DEM files into database image
_ Improve README
diff -r 278d285a16bf -r c3afc0274bba docker/Dockerfile.artifacts
--- a/docker/Dockerfile.artifacts Mon Mar 22 14:45:36 2021 +0100
+++ b/docker/Dockerfile.artifacts Mon Mar 22 17:35:30 2021 +0100
@@ -8,7 +8,15 @@
RUN yum -y install yum-plugin-ovl
# Install prerequisites
-RUN yum -y install maven mercurial
+RUN yum -y install maven mercurial curl
+
+# Add DEMs from demo dataset
+ENV DEM_DIR /opt/d4e-river/dgm
+ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz
+RUN mkdir -p $DEM_DIR
+RUN curl -s "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
+ tar -C $DEM_DIR --strip-components=1 --wildcards -xz 'demodaten/dem*.grd'
+
WORKDIR /opt/d4e
ENV REPO_URL https://scm.wald.intevation.org/hg/dive4elements/
@@ -24,6 +32,12 @@
RUN mvn -q -f river/backend/pom.xml install
WORKDIR river/artifacts
+
+# Install WSPLGEN
+ENV WSPLGEN_URL https://wald.intevation.org/frs/download.php/1496/wsplgen-linux-64bit-static.gz
+RUN curl -s $WSPLGEN_URL | gunzip > bin/wsplgen && chmod +x bin/wsplgen
+
+# Create h2 databases
RUN ../../framework/artifact-database/bin/createArtifacts.sh && \
mv artifactsdb doc/
RUN ./bin/createDatacage.sh && \
@@ -33,4 +47,5 @@
CMD mvn -Dexec.mainClass=org.dive4elements.artifactdatabase.App \
-Dartifact.database.dir="/opt/d4e/river/artifacts/doc/conf" \
+ -Dwsplgen.bin.path="/opt/d4e/river/artifacts/bin/wsplgen" \
compile exec:java
diff -r 278d285a16bf -r c3afc0274bba docker/Dockerfile.db
--- a/docker/Dockerfile.db Mon Mar 22 14:45:36 2021 +0100
+++ b/docker/Dockerfile.db Mon Mar 22 17:35:30 2021 +0100
@@ -57,8 +57,8 @@
# Go to postgres home for write permissions
WORKDIR /var/lib/postgresql
ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz
-RUN curl -k "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
- tar xz
+RUN curl -s "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
+ tar --wildcards -xz 'demodaten/*.dump.sql'
ENV PGDATA /var/lib/postgresql/9.4/main
RUN /usr/lib/postgresql/9.4/bin/pg_ctl start -wo "--config_file=$PGCONF" && \
diff -r 278d285a16bf -r c3afc0274bba docker/README
--- a/docker/README Mon Mar 22 14:45:36 2021 +0100
+++ b/docker/README Mon Mar 22 17:35:30 2021 +0100
@@ -25,7 +25,8 @@
$ docker run --name d4eriver-client --network d4e_river \
-v $PWD:/opt/d4e/river -dp 8080:8080 d4e/river_client
-The application should now be accessible on your docker host under /d4e-river.
+The application should now be accessible on your docker host under
+port 8080 and path /d4e-river (e.g. http://your-host:8080/d4e-river).
See docker/flys_user_file for credentials.
More information about the Dive4Elements-commits
mailing list