annotate docker/Dockerfile.artifacts @ 9803:a440ebd5c23b 3.2.x tip

Avoid using outdated mod_wsgi in Docker setup Run Wiki in standalone mode behind reverse proxy, which is provided by a more up-to-date Apache web server. The wiki container is still based on CentOS 7, because the included SSO integration component cannot be build with more recent libraries.
author Tom Gottfried <tom@intevation.de>
date Wed, 21 Aug 2024 16:54:17 +0200
parents a9641367812c
children
rev   line source
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
1 # Docker file for D4E River artifact server
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
2
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
3 FROM centos:7
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
4 MAINTAINER tom@intevation.de
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
5
9715
278d285a16bf Ensure needed packages are installed
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
6 # Necessary to run further yum-installs inside Docker container,
278d285a16bf Ensure needed packages are installed
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
7 # if not already part of the base image:
9732
a6c6bba0fc4b Run yum commands silently
Tom Gottfried <tom@intevation.de>
parents: 9731
diff changeset
8 RUN yum -q -y install yum-plugin-ovl && rpm --rebuilddb
9715
278d285a16bf Ensure needed packages are installed
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
9
9802
a9641367812c Improve locale support in artifacts container
Tom Gottfried <tom@intevation.de>
parents: 9782
diff changeset
10 # Re-install to gain locale support
a9641367812c Improve locale support in artifacts container
Tom Gottfried <tom@intevation.de>
parents: 9782
diff changeset
11 RUN yum -q -y reinstall glibc-common
a9641367812c Improve locale support in artifacts container
Tom Gottfried <tom@intevation.de>
parents: 9782
diff changeset
12
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
13 # Install prerequisites
9732
a6c6bba0fc4b Run yum commands silently
Tom Gottfried <tom@intevation.de>
parents: 9731
diff changeset
14 RUN yum -q -y install maven mercurial curl
9716
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
15
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
16 # Add DEMs from demo dataset
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
17 ENV DEM_DIR /opt/d4e-river/dgm
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
18 ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
19 RUN mkdir -p $DEM_DIR
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
20 RUN curl -s "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
21 tar -C $DEM_DIR --strip-components=1 --wildcards -xz 'demodaten/dem*.grd'
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
22
9764
b5d4cb088737 Add named volume for DEM data
Tom Gottfried <tom@intevation.de>
parents: 9737
diff changeset
23 # Volume for DEM data
b5d4cb088737 Add named volume for DEM data
Tom Gottfried <tom@intevation.de>
parents: 9737
diff changeset
24 VOLUME $DEM_DIR
b5d4cb088737 Add named volume for DEM data
Tom Gottfried <tom@intevation.de>
parents: 9737
diff changeset
25
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
26
9731
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
27 WORKDIR /opt/d4e/src
9776
e5b86f024141 Update repository URL
Tom Gottfried <tom@intevation.de>
parents: 9764
diff changeset
28 ENV REPO_URL https://hg.wald.intevation.org/dive4elements/
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
29 ENV BRANCH 3.2.x
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
30 RUN hg clone -b $BRANCH $REPO_URL/framework
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
31 RUN hg clone -b $BRANCH $REPO_URL/http-client
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
32
9733
93b9034613bc Skip tests in docker build
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
33 RUN mvn -q -DskipTests -f framework/pom.xml install
93b9034613bc Skip tests in docker build
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
34 RUN mvn -q -DskipTests -f http-client/pom.xml install
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
35
9779
3847836c60b5 Improve backend build for different database backends
Tom Gottfried <tom@intevation.de>
parents: 9777
diff changeset
36 # If ORACLE=true, the oracle profile in the POM is activated
3847836c60b5 Improve backend build for different database backends
Tom Gottfried <tom@intevation.de>
parents: 9777
diff changeset
37 ARG ORACLE
9782
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
38 ADD ./backend river/backend
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
39 ADD checkstyle.xml river/
9733
93b9034613bc Skip tests in docker build
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
40 RUN mvn -q -DskipTests -f river/backend/pom.xml install
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
41
9782
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
42 # Download dependencies before adding sources to leverage build cache
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
43 ADD artifacts/pom.xml river/artifacts/
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
44 RUN mvn -q -f river/artifacts/pom.xml dependency:go-offline
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
45 ADD ./artifacts river/artifacts
c670bf2ec4b0 Download dependencies before adding sources to leverage build cache
Tom Gottfried <tom@intevation.de>
parents: 9779
diff changeset
46
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
47 WORKDIR river/artifacts
9716
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
48
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
49 # Install WSPLGEN
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
50 ENV WSPLGEN_URL https://wald.intevation.org/frs/download.php/1496/wsplgen-linux-64bit-static.gz
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
51 RUN curl -s $WSPLGEN_URL | gunzip > bin/wsplgen && chmod +x bin/wsplgen
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
52
c3afc0274bba Improve Docker-based development setup
Tom Gottfried <tom@intevation.de>
parents: 9715
diff changeset
53 # Create h2 databases
9777
f98e5c7775d2 Do not rely on scripts being executable
Tom Gottfried <tom@intevation.de>
parents: 9776
diff changeset
54 RUN sh ../../framework/artifact-database/bin/createArtifacts.sh
f98e5c7775d2 Do not rely on scripts being executable
Tom Gottfried <tom@intevation.de>
parents: 9776
diff changeset
55 RUN sh ./bin/createDatacage.sh
9731
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
56
9733
93b9034613bc Skip tests in docker build
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
57 RUN mvn -q -DskipTests package assembly:single
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
58
9731
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
59 WORKDIR /opt/d4e/bin
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
60 RUN useradd d4e
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
61 RUN chown d4e:d4e .
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
62 USER d4e
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
63
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
64 RUN tar -xf ../src/river/artifacts/target/river-artifacts-1.0-SNAPSHOT-bin.tar
1dfcbb09c231 Improve server deployment in Docker container
Tom Gottfried <tom@intevation.de>
parents: 9726
diff changeset
65
9777
f98e5c7775d2 Do not rely on scripts being executable
Tom Gottfried <tom@intevation.de>
parents: 9776
diff changeset
66 CMD sh bin/run.sh

http://dive4elements.wald.intevation.org