-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from geonetwork/master
update parent
- Loading branch information
Showing
13 changed files
with
249 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
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,24 @@ | ||
FROM tomcat:8.0-jre8 | ||
|
||
ENV GN_FILE geonetwork.war | ||
ENV DATA_DIR=$CATALINA_HOME/webapps/geonetwork/WEB-INF/data | ||
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -server -Xms512m -Xmx2024m -XX:NewSize=512m -XX:MaxNewSize=1024m -XX:+UseConcMarkSweepGC" | ||
|
||
#Environment variables | ||
ENV GN_VERSION 3.2.2 | ||
ENV GN_DOWNLOAD_MD5 93b5279223503106ffeea3e9ca697805 | ||
|
||
WORKDIR $CATALINA_HOME/webapps | ||
|
||
RUN curl -fSL -o $GN_FILE \ | ||
https://sourceforge.net/projects/geonetwork/files/GeoNetwork_opensource/v${GN_VERSION}/geonetwork.war/download && \ | ||
echo "$GN_DOWNLOAD_MD5 *$GN_FILE" | md5sum -c && \ | ||
mkdir -p geonetwork && \ | ||
unzip -e $GN_FILE -d geonetwork && \ | ||
rm $GN_FILE | ||
|
||
#Set geonetwork data dir | ||
COPY ./docker-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["catalina.sh", "run"] |
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,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" = 'catalina.sh' ]; then | ||
|
||
mkdir -p "$DATA_DIR" | ||
|
||
#Set geonetwork data dir | ||
export CATALINA_OPTS="$CATALINA_OPTS -Dgeonetwork.dir=$DATA_DIR" | ||
fi | ||
|
||
exec "$@" |
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,16 @@ | ||
FROM geonetwork:3.2.2 | ||
|
||
RUN apt-get update && apt-get install -y postgresql-client && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
#Set PostgreSQL as default GN DB | ||
RUN sed -i -e 's#<import resource="../config-db/h2.xml"/>#<!--<import resource="../config-db/h2.xml"/> -->#g' $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-node/srv.xml && \ | ||
sed -i -e 's#<!--<import resource="../config-db/postgres.xml"/>-->#<import resource="../config-db/postgres.xml"/>#g' $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-node/srv.xml | ||
|
||
COPY ./jdbc.properties $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
|
||
#Initializing database & connection string for GN | ||
COPY ./docker-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["catalina.sh", "run"] |
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,51 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" = 'catalina.sh' ]; then | ||
|
||
mkdir -p "$DATA_DIR" | ||
|
||
#Set geonetwork data dir | ||
export CATALINA_OPTS="$CATALINA_OPTS -Dgeonetwork.dir=$DATA_DIR" | ||
|
||
#Setting host (use $POSTGRES_DB_HOST if it's set, otherwise use "postgres") | ||
db_host="${POSTGRES_DB_HOST:-postgres}" | ||
echo "db host: $db_host" | ||
|
||
#Setting port | ||
db_port="${POSTGRES_DB_PORT:-5432}" | ||
echo "db port: $db_port" | ||
|
||
if [ -z "$POSTGRES_DB_USERNAME" ] || [ -z "$POSTGRES_DB_PASSWORD" ]; then | ||
echo >&2 "you must set POSTGRES_DB_USERNAME and POSTGRES_DB_PASSWORD" | ||
exit 1 | ||
fi | ||
|
||
db_admin="admin" | ||
db_gn="geonetwork" | ||
|
||
#Create databases, if they do not exist yet (http://stackoverflow.com/a/36591842/433558) | ||
echo "$db_host:$db_port:*:$POSTGRES_DB_USERNAME:$POSTGRES_DB_PASSWORD" > ~/.pgpass | ||
chmod 0600 ~/.pgpass | ||
for db_name in "$db_admin" "$db_gn"; do | ||
if psql -h "$db_host" -U "$POSTGRES_DB_USERNAME" -p "$db_port" -tqc "SELECT 1 FROM pg_database WHERE datname = '$db_name'" | grep -q 1; then | ||
echo "database '$db_name' exists; skipping createdb" | ||
else | ||
createdb -h "$db_host" -U "$POSTGRES_DB_USERNAME" -p "$db_port" -O "$POSTGRES_DB_USERNAME" "$db_name" | ||
fi | ||
done | ||
rm ~/.pgpass | ||
|
||
#Write connection string for GN | ||
sed -ri '/^jdbc[.](username|password|database|host|port)=/d' "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.username=$POSTGRES_DB_USERNAME" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.password=$POSTGRES_DB_PASSWORD" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.database=$db_gn" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.host=$db_host" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.port=$db_port" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
|
||
#Fixing an hardcoded port on the connection string (bug fixed on development branch) | ||
sed -i -e 's#5432#${jdbc.port}#g' $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-db/postgres.xml | ||
fi | ||
|
||
exec "$@" |
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 @@ | ||
jdbc.basic.removeAbandoned=true | ||
jdbc.basic.removeAbandonedTimeout=120 | ||
jdbc.basic.logAbandoned=true | ||
jdbc.basic.maxActive=33 | ||
jdbc.basic.maxIdle=${jdbc.basic.maxActive} | ||
jdbc.basic.initialSize=${jdbc.basic.maxActive} | ||
jdbc.basic.maxWait=200 | ||
jdbc.basic.testOnBorrow=true | ||
jdbc.basic.timeBetweenEvictionRunsMillis=10000 | ||
jdbc.basic.minEvictableIdleTimeMillis=1800000 | ||
jdbc.basic.testWhileIdle=true | ||
jdbc.basic.numTestsPerEvictionRun=3 | ||
jdbc.basic.poolPreparedStatements=true | ||
jdbc.basic.maxOpenPreparedStatements=1200 | ||
jdbc.basic.validationQuery=SELECT 1 | ||
jdbc.basic.defaultReadOnly=false | ||
jdbc.basic.defaultAutoCommit=false |
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,24 @@ | ||
FROM tomcat:8.0-jre8 | ||
|
||
ENV GN_FILE geonetwork.war | ||
ENV DATA_DIR=$CATALINA_HOME/webapps/geonetwork/WEB-INF/data | ||
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -server -Xms512m -Xmx2024m -XX:NewSize=512m -XX:MaxNewSize=1024m -XX:+UseConcMarkSweepGC" | ||
|
||
#Environment variables | ||
ENV GN_VERSION 3.4.0 | ||
ENV GN_DOWNLOAD_MD5 f7d274a5f49d5f0968b204d290308943 | ||
|
||
WORKDIR $CATALINA_HOME/webapps | ||
|
||
RUN curl -fSL -o $GN_FILE \ | ||
https://sourceforge.net/projects/geonetwork/files/GeoNetwork_opensource/v${GN_VERSION}/geonetwork.war/download && \ | ||
echo "$GN_DOWNLOAD_MD5 *$GN_FILE" | md5sum -c && \ | ||
mkdir -p geonetwork && \ | ||
unzip -e $GN_FILE -d geonetwork && \ | ||
rm $GN_FILE | ||
|
||
#Set geonetwork data dir | ||
COPY ./docker-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["catalina.sh", "run"] |
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,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" = 'catalina.sh' ]; then | ||
|
||
mkdir -p "$DATA_DIR" | ||
|
||
#Set geonetwork data dir | ||
export CATALINA_OPTS="$CATALINA_OPTS -Dgeonetwork.dir=$DATA_DIR" | ||
fi | ||
|
||
exec "$@" |
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,16 @@ | ||
FROM geonetwork:3.4.0 | ||
|
||
RUN apt-get update && apt-get install -y postgresql-client && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
#Set PostgreSQL as default GN DB | ||
RUN sed -i -e 's#<import resource="../config-db/h2.xml"/>#<!--<import resource="../config-db/h2.xml"/> -->#g' $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-node/srv.xml && \ | ||
sed -i -e 's#<!--<import resource="../config-db/postgres.xml"/>-->#<import resource="../config-db/postgres.xml"/>#g' $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-node/srv.xml | ||
|
||
COPY ./jdbc.properties $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
|
||
#Initializing database & connection string for GN | ||
COPY ./docker-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["catalina.sh", "run"] |
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,51 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" = 'catalina.sh' ]; then | ||
|
||
mkdir -p "$DATA_DIR" | ||
|
||
#Set geonetwork data dir | ||
export CATALINA_OPTS="$CATALINA_OPTS -Dgeonetwork.dir=$DATA_DIR" | ||
|
||
#Setting host (use $POSTGRES_DB_HOST if it's set, otherwise use "postgres") | ||
db_host="${POSTGRES_DB_HOST:-postgres}" | ||
echo "db host: $db_host" | ||
|
||
#Setting port | ||
db_port="${POSTGRES_DB_PORT:-5432}" | ||
echo "db port: $db_port" | ||
|
||
if [ -z "$POSTGRES_DB_USERNAME" ] || [ -z "$POSTGRES_DB_PASSWORD" ]; then | ||
echo >&2 "you must set POSTGRES_DB_USERNAME and POSTGRES_DB_PASSWORD" | ||
exit 1 | ||
fi | ||
|
||
db_admin="admin" | ||
db_gn="geonetwork" | ||
|
||
#Create databases, if they do not exist yet (http://stackoverflow.com/a/36591842/433558) | ||
echo "$db_host:$db_port:*:$POSTGRES_DB_USERNAME:$POSTGRES_DB_PASSWORD" > ~/.pgpass | ||
chmod 0600 ~/.pgpass | ||
for db_name in "$db_admin" "$db_gn"; do | ||
if psql -h "$db_host" -U "$POSTGRES_DB_USERNAME" -p "$db_port" -tqc "SELECT 1 FROM pg_database WHERE datname = '$db_name'" | grep -q 1; then | ||
echo "database '$db_name' exists; skipping createdb" | ||
else | ||
createdb -h "$db_host" -U "$POSTGRES_DB_USERNAME" -p "$db_port" -O "$POSTGRES_DB_USERNAME" "$db_name" | ||
fi | ||
done | ||
rm ~/.pgpass | ||
|
||
#Write connection string for GN | ||
sed -ri '/^jdbc[.](username|password|database|host|port)=/d' "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.username=$POSTGRES_DB_USERNAME" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.password=$POSTGRES_DB_PASSWORD" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.database=$db_gn" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.host=$db_host" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
echo "jdbc.port=$db_port" >> "$CATALINA_HOME"/webapps/geonetwork/WEB-INF/config-db/jdbc.properties | ||
|
||
#Fixing an hardcoded port on the connection string (bug fixed on development branch) | ||
sed -i -e 's#5432#${jdbc.port}#g' $CATALINA_HOME/webapps/geonetwork/WEB-INF/config-db/postgres.xml | ||
fi | ||
|
||
exec "$@" |
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 @@ | ||
jdbc.basic.removeAbandoned=true | ||
jdbc.basic.removeAbandonedTimeout=120 | ||
jdbc.basic.logAbandoned=true | ||
jdbc.basic.maxActive=33 | ||
jdbc.basic.maxIdle=${jdbc.basic.maxActive} | ||
jdbc.basic.initialSize=${jdbc.basic.maxActive} | ||
jdbc.basic.maxWait=200 | ||
jdbc.basic.testOnBorrow=true | ||
jdbc.basic.timeBetweenEvictionRunsMillis=10000 | ||
jdbc.basic.minEvictableIdleTimeMillis=1800000 | ||
jdbc.basic.testWhileIdle=true | ||
jdbc.basic.numTestsPerEvictionRun=3 | ||
jdbc.basic.poolPreparedStatements=true | ||
jdbc.basic.maxOpenPreparedStatements=1200 | ||
jdbc.basic.validationQuery=SELECT 1 | ||
jdbc.basic.defaultReadOnly=false | ||
jdbc.basic.defaultAutoCommit=false |
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