Add: Tomcat, Solr, Fedora Docker files && basic config

This commit is contained in:
Luca 2022-10-21 15:48:15 +00:00
parent d4e8c8b49b
commit aeafd6f82b
14 changed files with 3230 additions and 1 deletions

View File

@ -13,8 +13,9 @@ RUN apt install -y \
php5.6-gd php5.6-curl php5.6-mcrypt php5.6-imagick php5.6-json php5.6-xsl php5.6-mysql php5.6-apcu php5.6-common php5.6-gd php5.6-curl php5.6-mcrypt php5.6-imagick php5.6-json php5.6-xsl php5.6-mysql php5.6-apcu php5.6-common
RUN a2enmod proxy* RUN a2enmod proxy*
RUN a2enmod rewrite
COPY data/ /var/www/2017.artxibo.arteleku.net/ COPY server/data/ /var/www/2017.artxibo.arteleku.net/
RUN chown -R www-data:www-data /var/www/ RUN chown -R www-data:www-data /var/www/

View File

@ -28,5 +28,26 @@ docker-compose up -d
docker exec -i <container_id> mysql -u<mysql-user> -p<mysql-pass> <mysql-database> < database.dump.sql docker exec -i <container_id> mysql -u<mysql-user> -p<mysql-pass> <mysql-database> < database.dump.sql
## Config Drupal
/sites/default/
$databases = array (
....
database => 'name',
username => user
password => pass
host => host
)
$base_url = "http://myhost.drupal.net";
## Config Islandora
### Configure Solr
/es/user/3#overlay=es/admin/islandora/search/islandora_solr
Server: 172.17.0.1:8080/solr

6
Solr.Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM solr:8
USER solr
COPY config/schema.xml /var/solr/data/collection1/conf/schema.xml
COPY config/solrconfig.xml /var/solr/data/collection1/conf/solrconfig.xml

45
Tomcat.Dockerfile Normal file
View File

@ -0,0 +1,45 @@
FROM debian:stable-slim
ENV TOMCAT_TARBALL_LINK https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.68/bin/apache-tomcat-9.0.68.tar.gz
ENV TOMCAT_DIRECTORY apache-tomcat-9.0.68
RUN apt-get update && apt-get dist-upgrade -y
RUN apt-get -y install openjdk-11-jdk openjdk-11-jre
RUN addgroup tomcat
RUN adduser tomcat --ingroup tomcat --home /opt/tomcat --shell /usr/bin
RUN apt-get -y install wget
RUN wget -O /tmp/tomcat.tar.gz $TOMCAT_TARBALL_LINK
RUN tar -zxvf /tmp/tomcat.tar.gz
WORKDIR /opt/tomcat
RUN mv /$TOMCAT_DIRECTORY/* /opt/tomcat/
RUN chown -R tomcat:tomcat /opt/tomcat
COPY fcrepo/setenv.sh /opt/tomcat/bin/setenv.sh
COPY fcrepo/tomcat.service /etc/systemd/system/tomcat.service
## Fedora
COPY fcrepo/i8_namespaces.cnd /opt/fcrepo/config/i8_namespaces.cnd
COPY fcrepo/allowed_hosts.txt /opt/fcrepo/config/allowed_hosts.txt
COPY fcrepo/repository.json /opt/fcrepo/config/repository.json
COPY fcrepo/fcrepo-config.xml /opt/fcrepo/config/fcrepo-config.xml
COPY fcrepo/tomcat-users.xml /opt/tomcat/conf/tomcat-users.xml
RUN mkdir -p /opt/fcrepo/data/objects
RUN mkdir -p /opt/fcrepo/config
RUN chown -R tomcat:tomcat /opt/fcrepo
ENV FCREPO_WAR_URL https://github.com/fcrepo/fcrepo/releases/download/fcrepo-6.2.0/fcrepo-webapp-6.2.0.war
RUN wget -O fcrepo.war $FCREPO_WAR_URL
RUN mv fcrepo.war /opt/tomcat/webapps
RUN chown tomcat:tomcat /opt/tomcat/webapps/fcrepo.war
ENTRYPOINT /opt/tomcat/bin/catalina.sh run

1144
config/schema.xml Normal file

File diff suppressed because it is too large Load Diff

1793
config/solrconfig.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
volumes:
solr:
version: "2.4" version: "2.4"
services: services:
db: db:
@ -16,3 +18,34 @@ services:
restart: always restart: always
ports: ports:
- 8888:80 - 8888:80
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- 8889:80
environment:
- PMA_HOST=db
solr:
image: solr:5.5
#build:
# context: .
# dockerfile: Solr.Dockerfile
volumes:
- solr:/opt/solr/server/solr
restart: always
ports:
- 8887:8983
tomcat:
build:
context: .
dockerfile: Tomcat.Dockerfile
restart: always
ports:
- 8886:8080
pg:
image: postgres:15
restart: always
environment:
- POSTGRES_DB=fedora
- POSTGRES_USER=fedora
- POSTGRES_PASSWORD=fedora

1
fcrepo/allowed_hosts.txt Normal file
View File

@ -0,0 +1 @@
http://CRAYFISH_HOST:CRAYFISH_PORT/

88
fcrepo/fcrepo-config.xml Normal file
View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<context:property-placeholder/>
<context:annotation-config/>
<context:component-scan base-package="org.fcrepo"/>
<bean name="modeshapeRepofactory"
class="org.fcrepo.kernel.modeshape.spring.ModeShapeRepositoryFactoryBean"
p:repositoryConfiguration="file:///opt/fcrepo/config/repository.json"
depends-on="authenticationProvider"/>
<bean name="authenticationProvider" class="org.fcrepo.auth.common.ShiroAuthenticationProvider"/>
<bean name="headerProvider" class="org.fcrepo.auth.common.HttpHeaderPrincipalProvider">
<property name="headerName" value="X-Islandora"/>
<property name="separator" value=","/>
</bean>
<bean name="delegatedPrincipalProvider" class="org.fcrepo.auth.common.DelegateHeaderPrincipalProvider"/>
<bean name="accessRolesProvider" class="org.fcrepo.auth.webac.WebACRolesProvider"/>
<bean id="webACAuthorizingRealm" class="org.fcrepo.auth.webac.WebACAuthorizingRealm" />
<bean id="servletContainerAuthenticatingRealm" class="org.fcrepo.auth.common.ServletContainerAuthenticatingRealm" />
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realms">
<util:set set-class="java.util.HashSet">
<ref bean="webACAuthorizingRealm"/>
<ref bean="servletContainerAuthenticatingRealm"/>
</util:set>
</property>
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
<bean id="servletContainerAuthFilter" class="org.fcrepo.auth.common.ServletContainerAuthFilter"/>
<bean id="webACFilter" class="org.fcrepo.auth.webac.WebACFilter"/>
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
<property name="filterChainDefinitions">
<value>
/** = servletContainerAuthFilter,headerProvider,delegatedPrincipalProvider,webACFilter
</value>
</property>
</bean>
<util:list id="translationChain" value-type="org.fcrepo.kernel.api.identifiers.InternalIdentifierConverter">
<bean class="org.fcrepo.kernel.modeshape.identifiers.HashConverter"/>
<bean class="org.fcrepo.kernel.modeshape.identifiers.NamespaceConverter"/>
</util:list>
<bean class="org.fcrepo.jms.JMSTopicPublisher">
<constructor-arg value="fedora"/>
</bean>
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="jmsBroker"
p:brokerURL="vm://${fcrepo.jms.host:localhost}:${fcrepo.dynamic.jms.port:61616}?create=false"/>
<bean name="jmsBroker" class="org.apache.activemq.xbean.BrokerFactoryBean"
p:config="${fcrepo.activemq.configuration:classpath:/config/activemq.xml}" p:start="true"/>
<bean class="org.fcrepo.jms.DefaultMessageFactory"/>
<bean class="org.fcrepo.kernel.modeshape.observer.SimpleObserver"/>
<bean name="fedoraEventFilter" class="org.fcrepo.kernel.modeshape.observer.DefaultFilter"/>
<bean name="fedoraEventMapper" class="org.fcrepo.kernel.modeshape.observer.eventmappings.AllNodeEventsOneEvent"/>
<bean name="fedoraInternalEventBus" class="com.google.common.eventbus.EventBus"/>
<bean name="rdfNamespaceRegistry" class="org.fcrepo.kernel.api.rdf.RdfNamespaceRegistry"
init-method="init" destroy-method="shutdown">
<property name="configPath" value="${fcrepo.namespace.registry:classpath:/namespaces.yml}" />
<property name="monitorForChanges" value="true" />
</bean>
<bean name="externalContentPathValidator" class="org.fcrepo.http.api.ExternalContentPathValidator"
init-method="init" destroy-method="shutdown">
<property name="configPath" value="${fcrepo.external.content.allowed:#{null}}" />
<property name="monitorForChanges" value="true" />
</bean>
<bean name="externalContentHandlerFactory" class="org.fcrepo.http.api.ExternalContentHandlerFactory">
<property name="validator" ref="externalContentPathValidator" />
</bean>
<task:scheduler id="taskScheduler" />
<task:executor id="taskExecutor" pool-size="1" />
<task:annotation-driven executor="taskExecutor" scheduler="taskScheduler" />
<bean class="org.modeshape.jcr.ModeShapeEngine" init-method="start"/>
<bean id="connectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager" />
<bean class="org.fcrepo.http.commons.session.SessionFactory"/>
</beans>

31
fcrepo/i8_namespaces.cnd Normal file
View File

@ -0,0 +1,31 @@
<acl = 'http://www.w3.org/ns/auth/acl#'>
<bf = 'http://id.loc.gov/ontologies/bibframe/'>
<cc = 'http://creativecommons.org/ns#'>
<dcterms = 'http://purl.org/dc/terms/'>
<dwc = 'http://rs.tdwg.org/dwc/terms/'>
<exif = 'http://www.w3.org/2003/12/exif/ns#'>
<fedoramodel = 'info:fedora/fedora-system:def/model#'>
<geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#'>
<gn = 'http://www.geonames.org/ontology#'>
<iana = 'http://www.iana.org/assignments/relation/'>
<islandorarelsext = 'http://islandora.ca/ontology/relsext#'>
<islandorarelsint = 'http://islandora.ca/ontology/relsint#'>
<ldp = 'http://www.w3.org/ns/ldp#'>
<nfo = 'http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#'>
<ore = 'http://www.openarchives.org/ore/terms/'>
<owl = 'http://www.w3.org/2002/07/owl#'>
<pcdm = 'http://pcdm.org/models#'>
<pcdmfmt = 'http://pcdm.org/file-format-types#'>
<pcdmrts = 'http://pcdm.org/rights#'>
<pcdmuse = 'http://pcdm.org/use#'>
<pcdmwrks = 'http://pcdm.org/works#'>
<prov = 'http://www.w3.org/ns/prov#'>
<rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdfs = 'http://www.w3.org/2000/01/rdf-schema#'>
<rel = 'http://id.loc.gov/vocabulary/relators/'>
<schema = 'http://schema.org/'>
<skos = 'http://www.w3.org/2004/02/skos/core#'>
<xml = 'http://www.w3.org/XML/1998/namespace'>
<xmlns = 'http://www.w3.org/2000/xmlns/'>
<xs = 'http://www.w3.org/2001/XMLSchema'>
<xsi = 'http://www.w3.org/2001/XMLSchema-instance'>

39
fcrepo/repository.json Normal file
View File

@ -0,0 +1,39 @@
{
"name" : "repo",
"jndiName" : "",
"workspaces" : {
"predefined" : ["default"],
"default" : "default",
"allowCreation" : true,
"cacheSize" : 10000
},
"storage" : {
"persistence": {
"type" : "db",
"connectionUrl": "jdbc:postgresql://pg:5432/fedora",
"driver" : "org.postgresql.Driver",
"username" : "fedora",
"password" : "fedora"
},
"binaryStorage" : {
"type" : "file",
"directory" : "/opt/fcrepo/data/binaries",
"minimumBinarySizeInBytes" : 4096
}
},
"security" : {
"anonymous" : {
"roles" : ["readonly","readwrite","admin"],
"useOnFailedLogin" : false
},
"providers" : [
{ "classname" : "org.fcrepo.auth.common.BypassSecurityServletAuthenticationProvider" }
]
},
"garbageCollection" : {
"threadPool" : "modeshape-gc",
"initialTime" : "00:00",
"intervalInHours" : 24
},
"node-types" : ["fedora-node-types.cnd", "file:/opt/fcrepo/config/i8_namespaces.cnd"]
}

4
fcrepo/setenv.sh Normal file
View File

@ -0,0 +1,4 @@
export CATALINA_HOME="/opt/tomcat"
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
#export JAVA_OPTS="-Djava.awt.headless=true -server -Xmx1500m -Xms1000m"
export JAVA_OPTS="-Djava.awt.headless=true -Dfcrepo.home=/otp/fcrepo/data -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log -Dfcrepo.jms.baseUrl=http://localhost:8080/fcrepo/rest -Dfcrepo.autoversioning.enabled=false -DconnectionTimeout=-1 -Dfcrepo.db.url=jdbc:postgresql://pg:5432/fedora -Dfcrepo.db.user=fedora -Dfcrepo.db.password=fedora -server -Xmx1500m -Xms1000m"

12
fcrepo/tomcat-users.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="tomcat"/>
<role rolename="fedoraAdmin"/>
<role rolename="fedoraUser"/>
<user username="tomcat" password="islandora" roles="tomcat"/>
<user username="fedoraAdmin" password="islandora" roles="fedoraAdmin"/>
<user username="fedoraUser" password="islandora" roles="fedoraUser"/>
</tomcat-users>

11
fcrepo/tomcat.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Tomcat
[Service]
Type=forking
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
SyslogIdentifier=tomcat
[Install]
WantedBy=multi-user.target