-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locally building docker container with 'overlayed' war
- Loading branch information
Showing
8 changed files
with
295 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM jetty:9-jdk11 | ||
|
||
ENV DATA_DIR /catalogue-data | ||
ENV WEBAPP_CONTEXT_PATH /geonetwork | ||
ENV GN_CONFIG_PROPERTIES -Dgeonetwork.dir=${DATA_DIR} \ | ||
-Dgeonetwork.formatter.dir=${DATA_DIR}/data/formatter \ | ||
-Dgeonetwork.schema.dir=/opt/geonetwork/WEB-INF/data/config/schema_plugins \ | ||
-Dgeonetwork.indexConfig.dir=/opt/geonetwork/WEB-INF/data/config/index | ||
|
||
|
||
ENV JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true \ | ||
-Xms512M -Xss512M -Xmx2G -XX:+UseConcMarkSweepGC | ||
|
||
USER root | ||
RUN apt-get -y update && \ | ||
apt-get -y install --no-install-recommends \ | ||
curl \ | ||
unzip && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
mkdir -p ${DATA_DIR} && \ | ||
chown -R jetty:jetty ${DATA_DIR} && \ | ||
mkdir -p /opt/geonetwork && \ | ||
chown -R jetty:jetty /opt/geonetwork | ||
|
||
USER jetty | ||
ENV GN_FILE geonetwork.war | ||
ENV GN_VERSION 4.4.6 | ||
ENV GN_DOWNLOAD_MD5 ad596d3348872506c78daa05edb14782 | ||
|
||
COPY geonetwork-4.4.6-0-swiss-custom.zip /opt/geonetwork/geonetwork-4.4.6-0-swiss-custom.zip | ||
RUN cd /opt/geonetwork/ && \ | ||
unzip -q geonetwork-4.4.6-0-swiss-custom.zip && \ | ||
unzip -q geonetwork.war && \ | ||
rm geonetwork.war | ||
|
||
COPY jetty/geonetwork_context_template.xml /usr/local/share/geonetwork/geonetwork_context_template.xml | ||
COPY ./docker-entrypoint.sh /geonetwork-entrypoint.sh | ||
|
||
RUN java -jar /usr/local/jetty/start.jar --create-startd --add-module=http-forwarded | ||
|
||
ENTRYPOINT ["/geonetwork-entrypoint.sh"] | ||
CMD ["java","-jar","/usr/local/jetty/start.jar"] | ||
|
||
VOLUME [ "${DATA_DIR}" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
export JAVA_OPTIONS="${JAVA_OPTS} ${GN_CONFIG_PROPERTIES}" | ||
|
||
GN_BASE_DIR=/opt/geonetwork | ||
|
||
if ! command -v -- "$1" >/dev/null 2>&1 ; then | ||
set -- java -jar "$JETTY_HOME/start.jar" "$@" | ||
fi | ||
|
||
if [[ "$1" = jetty.sh ]] || [[ $(expr "$*" : 'java .*/start\.jar.*$') != 0 ]]; then | ||
# Customize context path | ||
if [ ! -f "{$JETTY_BASE}/webapps/geonetwork.xml" ]; then | ||
echo "Using $WEBAPP_CONTEXT_PATH for deploying the application" | ||
cp /usr/local/share/geonetwork/geonetwork_context_template.xml "${JETTY_BASE}/webapps/geonetwork.xml" | ||
sed -i "s#GEONETWORK_CONTEXT_PATH#${WEBAPP_CONTEXT_PATH}#" "${JETTY_BASE}/webapps/geonetwork.xml" | ||
fi | ||
|
||
# Delegate on base image entrypoint to start jetty | ||
exec /docker-entrypoint.sh "$@" | ||
else | ||
exec "$@" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> | ||
|
||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> | ||
<Set name="contextPath">GEONETWORK_CONTEXT_PATH</Set> | ||
<Set name="war">/opt/geonetwork</Set> | ||
<Get name="systemClasspathPattern"> | ||
<Call name="add"><Arg>-javax.mail.</Arg></Call> | ||
</Get> | ||
<Get name="serverClasspathPattern"> | ||
<Call name="add"><Arg>javax.mail.</Arg></Call> | ||
</Get> | ||
<Call name="setAttribute"> | ||
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> | ||
<Arg>nomatches</Arg> | ||
</Call> | ||
</Configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>swiss-experiment</groupId> | ||
<artifactId>geonetwork</artifactId> | ||
<version>4.4.6-0</version> | ||
</parent> | ||
|
||
<artifactId>release</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
<name>GeoNetwork ${project.version} ${customer} Release</name> | ||
<description> | ||
Release packaging including installation notes and appropriate open source licenses. | ||
</description> | ||
|
||
<dependencies> | ||
<!-- war includes prebuilt geonetwork jars --> | ||
<dependency> | ||
<groupId>swiss-experiment</groupId> | ||
<artifactId>web</artifactId> | ||
<version>${project.version}</version> | ||
<type>war</type> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.3.1</version> | ||
<executions> | ||
<execution> | ||
<id>copy-resources</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${basedir}/target/docker</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>docker</directory> | ||
<filtering>false</filtering> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>bundle</id> | ||
<phase>package</phase> | ||
<goals><goal>single</goal></goals> | ||
<configuration> | ||
<recompressZippedFiles>false</recompressZippedFiles> | ||
<descriptors> | ||
<descriptor>src/assembly/bundle.xml</descriptor> | ||
</descriptors> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<outputDirectory>${project.build.directory}/docker</outputDirectory> | ||
<finalName>geonetwork-${project.version}-${customer.bundle}</finalName> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<assembly> | ||
<id>geonetwork</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<fileSets> | ||
<!-- plugin folder --> | ||
<fileSet> | ||
<directory>../web/target</directory> | ||
<outputDirectory></outputDirectory> | ||
<includes> | ||
<include>*.war</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
<files> | ||
<file> | ||
<source>toto.txt</source> | ||
<outputDirectory></outputDirectory> | ||
<destName>toto.txt</destName> | ||
</file> | ||
</files> | ||
<!-- | ||
<dependencySets> | ||
<dependencySet> | ||
<includes> | ||
<include>*:web:war</include> | ||
</includes> | ||
</dependencySet> | ||
</dependencySets>--> | ||
<!--moduleSets> | ||
<moduleSet> | ||
<useAllReactorProjects>true</useAllReactorProjects> | ||
<includes> | ||
<include>hnap-experiment:web</include> | ||
</includes> | ||
<sources> | ||
<includeModuleDirectory>false</includeModuleDirectory> | ||
<fileSets> | ||
<fileSet> | ||
<outputDirectory>sources/${module.artifactId}</outputDirectory> | ||
</fileSet> | ||
</fileSets> | ||
</sources> | ||
</moduleSet> | ||
</moduleSets--> | ||
</assembly> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
;-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>swiss-experiment</groupId> | ||
<artifactId>geonetwork</artifactId> | ||
<version>4.4.6-0</version> | ||
</parent> | ||
|
||
<artifactId>web</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>GeoNetwork Web Application for ${customer}</name> | ||
<description> | ||
Web application using maven war overlay functionality to reuse | ||
geonetwork war and hnap schema plugin for ${customer}. | ||
</description> | ||
|
||
<properties> | ||
<build.webapp.resources>${project.build.directory}/webapp</build.webapp.resources> | ||
<jetty.env>jetty-env.xml</jetty.env> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- war includes prebuilt geonetwork jars --> | ||
<dependency> | ||
<groupId>org.geonetwork-opensource</groupId> | ||
<artifactId>web-app</artifactId> | ||
<version>${project.version}</version> | ||
<type>war</type> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>geonetwork</finalName> | ||
<plugins> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<overlays> | ||
<overlay> | ||
<groupId>org.geonetwork-opensource</groupId> | ||
<artifactId>web-app</artifactId> | ||
</overlay> | ||
</overlays> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<version>${jetty.version}</version> | ||
<configuration> | ||
<contextXml>${basedir}/jetty-context.xml</contextXml> | ||
<webApp> | ||
<contextPath>/geonetwork</contextPath> | ||
<jettyEnvXml>${jetty.env}</jettyEnvXml> | ||
</webApp> | ||
</configuration> | ||
<!--<dependencies> | ||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<version>1.3.174</version> | ||
</dependency> | ||
</dependencies>--> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
|
||
</project> | ||
|