Skip to content

Commit

Permalink
Add GNOS 4 Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbllmnn committed Jul 13, 2023
1 parent 57e58be commit 89b4b8e
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
postgresql_data
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM geonetwork:4.2.4

USER root
RUN apt -y update && apt -y upgrade && apt -y install vim && apt clean
USER jetty

COPY WEB-INF/config-db/jdbc.properties /var/lib/jetty/webapps/geonetwork/WEB-INF/config-db/jdbc.properties
COPY WEB-INF/config-node/srv.xml /var/lib/jetty/webapps/geonetwork/WEB-INF/config-node/srv.xml
COPY WEB-INF/config.properties /var/lib/jetty/webapps/geonetwork/WEB-INF/config.properties
COPY catalog/components/search/mdview/partials/contact.html /var/lib/jetty/webapps/geonetwork/catalog/components/search/mdview/partials/contact.html
COPY catalog/locales/de-core.json /var/lib/jetty/webapps/geonetwork/catalog/locales/de-core.json
COPY catalog/locales/de-custom.json /var/lib/jetty/webapps/geonetwork/catalog/locales/de-custom.json
COPY catalog/style/srv_custom_style.less /var/lib/jetty/webapps/geonetwork/catalog/style/srv_custom_style.less
COPY catalog/style/gn_icons.less /var/lib/jetty/webapps/geonetwork/catalog/style/gn_icons.less
COPY catalog/views/default/less/gn_results_default.less /var/lib/jetty/webapps/geonetwork/catalog/views/default/less/gn_results_default.less
COPY catalog/views/default/less/gn_topics_default.less /var/lib/jetty/webapps/geonetwork/catalog/views/default/less/gn_topics_default.less
COPY catalog/views/default/less/gn_variables_default.less /var/lib/jetty/webapps/geonetwork/catalog/views/default/less/gn_variables_default.less
COPY catalog/views/default/templates/advancedSearchForm/defaultAdvancedSearchForm.html /var/lib/jetty/webapps/geonetwork/catalog/views/default/templates/advancedSearchForm/defaultAdvancedSearchForm.html
COPY catalog/views/default/templates/footer.html /var/lib/jetty/webapps/geonetwork/catalog/views/default/templates/footer.html
COPY catalog/views/default/templates/results.html /var/lib/jetty/webapps/geonetwork/catalog/views/default/templates/results.html
COPY Gn.js /var/lib/jetty/webapps/geonetwork/catalog/js/Gn.js
COPY log4j2.xml /var/lib/jetty/webapps/geonetwork/WEB-INF/classes/
81 changes: 81 additions & 0 deletions Gn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: [email protected]
*/

// Define root geonetwork namespace
var geonetwork = {};

(function () {
goog.provide("gn");

goog.require("gn_locale");
goog.require("gn_count_watchers");
goog.require("gn_polyfills");

/**
* Main gn module.
*
* Must be included by all uis.
* Is used in wro4j for $templatecache.
* Must contains only what is mendatory in all uis:
* - locale management
*
* @type {module|*}
*/
var module = angular.module("gn", ["gn_locale", "gn_config", "cfp.hotkeys"]);

// See https://docs.angularjs.org/guide/migration#commit-aa077e8
module.config([
"$locationProvider",
function ($locationProvider) {
// Configure existing providers
$locationProvider.hashPrefix("");
}
]);

window.addEventListener('hashchange', function() {
if (window.location.hash.startsWith('#/metadata')) {
this.window.setTimeout(function() {
var parents = document.querySelectorAll('.gn-metadata-display');
parents.forEach(function(parent) {
parent.querySelectorAll('a').forEach(function(a) {
var sameOrigin = a.href.startsWith('#') || a.href.startsWith(window.location.origin);
if (sameOrigin) {
delete a.target;
} else {
a.target = '_blank';
}
});
});
}, 1000);
}
if (window.location.hash.startsWith('#/search')) {
var nodes = document.querySelectorAll('[data-ng-click="next()"],[data-ng-click="previous()"]');
nodes.forEach(function(node) {
node.addEventListener('click', function() {
window.scrollTo(0, 0);
});
});
}
});

})();
8 changes: 4 additions & 4 deletions WEB-INF/config-db/jdbc.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
# Rome - Italy. email: [email protected]
#

jdbc.username=geonetwork
jdbc.password=gdibe_gn
jdbc.database=geonetwork
jdbc.host=10.10.114.113
jdbc.username=postgres
jdbc.password=postgres
jdbc.database=gnos
jdbc.host=postgres
jdbc.port=5432
jdbc.connectionProperties=#{systemEnvironment['GEONETWORK_DB_CONNECTION_PROPERTIES']}
jdbc.basic.removeAbandoned=true
Expand Down
32 changes: 17 additions & 15 deletions WEB-INF/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ usersavedselection.watchlist.frequency=0 0 4 * * ?
usersavedselection.watchlist.searchurl=catalog.search#/search?_uuid={{filter}}

# Define the link to each record sent by email by the watchlist notifier
usersavedselection.watchlist.recordurl=api/records/{{index:_uuid}}
usersavedselection.watchlist.recordurl=api/records/{{index:uuid}}

es.url=
es.protocol=http
es.port=9200
es.host=elasticsearch
es.url=${es.protocol}://${es.host}:${es.port}
es.username=
es.password=
es.index.features=
es.index.features.type=
es.index.features=gn-features
es.index.features.type=features
# Define the number of decimals to apply when converting geometries to GeoJSON
# Too high value means more volume. Adapt the value depending on the precision
# of the WFS harvested which usually allows to define a number of decimals
Expand All @@ -24,13 +27,15 @@ es.index.features.numberOfDecimals=8
# Force reduction of geometry precision based on the number of decimals
es.index.features.applyPrecisionModel=true
es.index.features.featureCommitInterval=250
es.index.records=
es.index.records.type=
es.index.records_public=
es.index.searchlogs=
es.index.searchlogs.type=
es.index.records=gn-records
es.index.records.type=records
es.index.records_public=${es.index.records_public}
es.index.searchlogs=gn-searchlogs
es.index.searchlogs.type=searchlogs

kb.url=
kb.url=http://kibana:5601

es.index.checker.interval=0/5 * * * * ?

jms.url=tcp://localhost:61616

Expand All @@ -40,12 +45,9 @@ api.params.maxPageSize=20000
api.params.maxUploadSize=100000000
urlChecker.UserAgent=GeoNetwork Link Checker

thesaurus.cache.maxsize=400000

map.bbox.background.service=https://sgx.geodatenzentrum.de/wms_basemapde?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&LAYERS=de_basemapde_web_raster_grau&STYLES=inspire_common:DEFAULT&SRS=25833&BBOX={minx},{miny},{maxx},{maxy}&WIDTH={width}&HEIGHT={height}&FORMAT=image/png

#map.bbox.background.service=https://isk.geobasis-bb.de/mapproxy/webatlasde/service/wms?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&LAYERS=WebAtlasDE_BEBB_grau&STYLES=default&SRS={srs}&BBOX={minx},{miny},{maxx},{maxy}&WIDTH={width}&HEIGHT={height}&FORMAT=image/png

#map.bbox.background.service=https://ows.terrestris.de/osm/service?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&LAYERS=OSM-WMS&STYLES=default&SRS={srs}&BBOX={minx},{miny},{maxx},{maxy}&WIDTH={width}&HEIGHT={height}&FORMAT=image/png
map.bbox.background.service=https://sgx.geodatenzentrum.de/wms_basemapde?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&LAYERS=de_basemapde_web_raster_grau&STYLES=inspire_common:DEFAULT&SRS={srs}&BBOX={minx},{miny},{maxx},{maxy}&WIDTH={width}&HEIGHT={height}&FORMAT=image/png

# Set to false to enable the services to draw map extents (region.getmap and {metadatauuid}/extents.png) accepting
# urls for map services to provide the background layers. Otherwise the only allowed options are from the settings
Expand Down
6 changes: 3 additions & 3 deletions catalog/style/srv_custom_style.less
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
background-color: white;
}
.table-striped > tbody > tr:nth-of-type(2n+1) {
background-color: white
background-color: white
}
.gn-bottom-bar {
height: 50px;
Expand Down Expand Up @@ -148,7 +148,7 @@
background-color: white;
}
.navbar-default {
border-color:black;
border-color: black;
}
.gn-bottom-bar a:hover {
color: white !important;
Expand All @@ -171,5 +171,5 @@
.navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > .open > a:focus, .navbar-default .navbar-nav > .active > a:focus {
background-color: transparent;
text-decoration: underline;
list-style-type: none !important;
}
.list-style-type: none !important;
4 changes: 4 additions & 0 deletions catalog/views/default/less/gn_variables_default.less
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@

// metadata page
@gn-md-view-background-color: @body-bg;
@gn-search-button-border-color: @btn-default-border;
@gn-outline: 2px auto @brand-primary;
@gn-search-button-border-color: @btn-default-border;
@gn-resultcard-title-border-color: @panel-default-border;
58 changes: 58 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: '3'
services:
gnos:
container_name: gnos
build:
dockerfile: Dockerfile
context: ./
restart: always
depends_on:
- postgres
ports:
- 8080:8080
environment:
DATA_DIR: /var/lib/geonetwork_data
ES_HOST: elasticsearch
ES_PROTOCOL: http
ES_PORT: 9200

KB_URL: http://kibana:5601
volumes:
- ./gn-public-data:/var/lib/geonetwork-data:z
- ./logs/:/var/lib/jetty/logs/:z
elasticsearch:
image: nexus.terrestris.de/elasticsearch:7.11.1
container_name: elasticsearch
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
environment:
ES_JAVA_OPTS: "-Xms1G -Xmx1G"
discovery.type: single-node
volumes:
- ./esdata-public:/var/lib/elasticsearch/data:z
kibana:
image: nexus.terrestris.de/kibana:7.11.1
container_name: kibana
environment:
SERVER_NAME: 'kibana'
ELASTICSEARCH_HOSTS: '["http://elasticsearch:9200"]'
SERVER_BASEPATH: '/geonetwork/dashboards'
SERVER_REWRITEBASEPATH: 'false'
KIBANA_INDEX: .dashboards
XPACK_MONITORING_UI_CONTAINER_ELASTICSEARCH_ENABLED: 'true'
postgres:
image: library/postgres:15
container_name: postgres
restart: always
volumes:
- ./postgresql_data:/var/lib/postgresql/data:z
- ./dumps:/dumps:z
ports:
- 5555:5432
environment:
POSTGRES_HOST_AUTH_METHOD: trust
Loading

0 comments on commit 89b4b8e

Please sign in to comment.