annotate docker/Dockerfile.gwt-client @ 9742:df5c6f3ef893 3.2.x

Do not run tomcat as root
author Tom Gottfried <tom@intevation.de>
date Mon, 29 Aug 2022 16:41:43 +0200
parents 4fabdc8ed97b
children d1dcb8d28b0d
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 GWT client
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: 9687
diff changeset
6 # Necessary to run further yum-installs inside Docker container,
278d285a16bf Ensure needed packages are installed
Tom Gottfried <tom@intevation.de>
parents: 9687
diff changeset
7 # if not already part of the base image:
9732
a6c6bba0fc4b Run yum commands silently
Tom Gottfried <tom@intevation.de>
parents: 9720
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: 9687
diff changeset
9
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
10 # Install prerequisites
9732
a6c6bba0fc4b Run yum commands silently
Tom Gottfried <tom@intevation.de>
parents: 9720
diff changeset
11 RUN yum -q -y install maven mercurial tomcat gnu-free-sans-fonts curl
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
12
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
13 WORKDIR /opt/d4e
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
14 ENV REPO_URL https://scm.wald.intevation.org/hg/dive4elements/
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
15 ENV BRANCH 3.2.x
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
16 RUN hg clone -b $BRANCH $REPO_URL/framework
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
17 RUN hg clone -b $BRANCH $REPO_URL/http-client
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
18
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
19 RUN mvn -q -f framework/pom.xml install
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
20 RUN mvn -q -f http-client/pom.xml install
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
21
9741
4fabdc8ed97b Fix installing SmartGWT
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
22 RUN curl -sLO "https://github.com/openlayers/ol2/releases/download/release-2.11/OpenLayers-2.11.tar.gz"
9685
2dad42df79a8 Add OpenLayers in Docker setup
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
23
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
24 # Use latest patch release and fake version=4.1-p20141119 to work around
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
25 # the actual version (which is known to work properly)
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
26 # is not publicly available
9741
4fabdc8ed97b Fix installing SmartGWT
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
27 RUN curl -sLO https://www.smartclient.com/builds/SmartGWT/4.1p/LGPL/latest/smartgwt.jar
4fabdc8ed97b Fix installing SmartGWT
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
28 RUN mvn -q install:install-file -Dfile=smartgwt.jar -Dversion=4.1-p20141119 \
4fabdc8ed97b Fix installing SmartGWT
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
29 -DartifactId=smartgwt-lgpl -DgroupId=com.isomorphic.smartgwt.lgpl \
4fabdc8ed97b Fix installing SmartGWT
Tom Gottfried <tom@intevation.de>
parents: 9732
diff changeset
30 -Dpackaging=jar
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
31
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
32 ADD . river
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
33
9685
2dad42df79a8 Add OpenLayers in Docker setup
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
34 RUN tar -C river/gwt-client/src/main/webapp \
2dad42df79a8 Add OpenLayers in Docker setup
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
35 --exclude=OpenLayers-2.11/doc --exclude=OpenLayers-2.11/tests \
2dad42df79a8 Add OpenLayers in Docker setup
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
36 --exclude=OpenLayers-2.11/examples -xf OpenLayers-2.11.tar.gz
2dad42df79a8 Add OpenLayers in Docker setup
Tom Gottfried <tom@intevation.de>
parents: 9684
diff changeset
37 RUN rm OpenLayers-2.11.tar.gz
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
38 RUN mvn -q -f river/gwt-client/pom.xml package && \
9686
33303817ed37 Deploy webapp as d4e-river
Tom Gottfried <tom@intevation.de>
parents: 9685
diff changeset
39 mv river/gwt-client/target/gwt-client-*.war \
33303817ed37 Deploy webapp as d4e-river
Tom Gottfried <tom@intevation.de>
parents: 9685
diff changeset
40 /usr/share/tomcat/webapps/d4e-river.war
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
41
9742
df5c6f3ef893 Do not run tomcat as root
Tom Gottfried <tom@intevation.de>
parents: 9741
diff changeset
42 USER tomcat
df5c6f3ef893 Do not run tomcat as root
Tom Gottfried <tom@intevation.de>
parents: 9741
diff changeset
43 ADD docker/flys_user_file /usr/share/tomcat/
9684
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
44
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
45 EXPOSE 8080
537fe44f2792 Add basic Docker setup for development
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
46 CMD ["/usr/libexec/tomcat/server", "start"]

http://dive4elements.wald.intevation.org