Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magnolia ce mysql #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
introduced mysql-ce-mysql
  • Loading branch information
Vincenzo Cerbone committed Sep 5, 2019
commit 58c4cacc53cf6dec1b040768a7592a5318dd78a6
14 changes: 14 additions & 0 deletions magnolia-ce-mysql/Dockerfile
@@ -0,0 +1,14 @@
ARG TOMCAT_VER
ARG JRE_VER
ARG DIST

FROM magnolia/magnolia-base:${TOMCAT_VER}-${JRE_VER}${DIST:+-$DIST}

ARG MGNL_VER
ENV MYSQL_VER 8.0.17

COPY files/repo.xml /etc/magnolia/repo.xml

RUN mkdir $CATALINA_HOME/lib/jdbc && \
wget -nv https://repo1.maven.org/maven2/mysql/mysql-connector-java/$MYSQL_VER/mysql-connector-java-$MYSQL_VER.jar -O $CATALINA_HOME/lib/mysql-connector-java-$MYSQL_VER.jar && \
wget -nv https://nexus.magnolia-cms.com/service/local/repositories/magnolia.public.releases/content/info/magnolia/bundle/magnolia-community-demo-webapp/$MGNL_VER/magnolia-community-demo-webapp-$MGNL_VER.war -O $CATALINA_HOME/webapps/ROOT.war
6 changes: 6 additions & 0 deletions magnolia-ce-mysql/args.csv
@@ -0,0 +1,6 @@
# Magnolia Version,Tomcat Version,JDK Version,Distribution
5.7.1,8.5.35,jre8,alpine
6.0,9.0.13,jre11,slim
6.1.2,9.0.24,jdk11-openjdk,slim
6.1.2,9.0.24,jdk11-corretto
#end
6 changes: 6 additions & 0 deletions magnolia-ce-mysql/build.sh
@@ -0,0 +1,6 @@
#!/bin/bash
docker build --build-arg MGNL_VER=$1 \
--build-arg TOMCAT_VER=$2 \
--build-arg JRE_VER=$3 \
--build-arg DIST=${4:+$4} \
--tag magnolia/magnolia-ce-mysql:$1-$2-$3${4:+-$4} .
55 changes: 55 additions & 0 deletions magnolia-ce-mysql/docker-compose.yml
@@ -0,0 +1,55 @@
version: '3'

services:

dbAuthor:
image: mysql:8.0.17
environment:
- MYSQL_DATABASE=magnolia
- MYSQL_USER=magnolia
- MYSQL_PASSWORD=mysecretpassword
- MYSQL_ROOT_PASSWORD=password

dbPublic:
image: mysql:8.0.17
environment:
- MYSQL_DATABASE=magnolia
- MYSQL_USER=magnolia
- MYSQL_PASSWORD=mysecretpassword
- MYSQL_ROOT_PASSWORD=password

author:
image: magnolia/magnolia-ce-mysql:6.1.2-9.0.24-jdk11-openjdk-slim
ports:
- "3000:8080"
links:
- dbAuthor:db
depends_on:
- dbAuthor
environment:
- INSTANCE_TYPE=author
- DB_ADDRESS=db
- DB_PORT=3306
- DB_SCHEMA=magnolia
- DB_USERNAME=magnolia
- DB_PASSWORD=mysecretpassword
- IS_AUTHOR=true
- DEVELOP_MODE=false

public:
image: magnolia/magnolia-ce-mysql:6.1.2-9.0.24-jdk11-openjdk-slim
ports:
- "3001:8080"
links:
- dbPublic:db
depends_on:
- dbPublic
environment:
- INSTANCE_TYPE=public
- DB_ADDRESS=db
- DB_PORT=3306
- DB_SCHEMA=magnolia
- DB_USERNAME=magnolia
- DB_PASSWORD=mysecretpassword
- IS_AUTHOR=false
- DEVELOP_MODE=false
76 changes: 76 additions & 0 deletions magnolia-ce-mysql/files/repo.xml
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN" "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
<Repository>
<DataSources>
<DataSource name="magnolia">
<param name="driver" value="com.mysql.cj.jdbc.Driver" />
<param name="databaseType" value="mysql"/>
<param name="url" value="jdbc:mysql://${db.address}:${db.port}/${db.schema}?autoReconnect=true&amp;useSSL=false&amp;allowPublicKeyRetrieval=true" />
<param name="user" value="${db.username}" />
<param name="password" value="${db.password}" />
<param name="validationQuery" value="select 1" />
</DataSource>
</DataSources>
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/repository" />
</FileSystem>
<Security appName="magnolia">
<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager"/>
<AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
</AccessManager>
<!-- login module defined here is used by the repo to authenticate every request. not by the webapp to authenticate user against the webapp context (this one has to be passed before thing here gets invoked -->
<LoginModule class="info.magnolia.jaas.sp.jcr.JackrabbitAuthenticationModule">
</LoginModule>
</Security>
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
<param name="path" value="${rep.home}/repository/datastore"/>
<param name="minRecordLength" value="1024"/>
</DataStore>
<Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
<Workspace name="default">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}/default" />
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager">
<param name="dataSourceName" value="magnolia"/>
<param name="schemaObjectPrefix" value="pm_${wsp.name}_" />
</PersistenceManager>
<SearchIndex class="info.magnolia.jackrabbit.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index" />
<!-- SearchIndex will get the indexing configuration from the classpath, if not found in the workspace home -->
<param name="indexingConfiguration" value="/info/magnolia/jackrabbit/indexing_configuration_${wsp.name}.xml"/>
<param name="useCompoundFile" value="true" />
<param name="minMergeDocs" value="100" />
<param name="volatileIdleTime" value="3" />
<param name="maxMergeDocs" value="100000" />
<param name="mergeFactor" value="10" />
<param name="maxFieldLength" value="10000" />
<param name="bufferSize" value="10" />
<param name="cacheSize" value="1000" />
<param name="forceConsistencyCheck" value="false" />
<param name="autoRepair" value="true" />
<param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl" />
<param name="respectDocumentOrder" value="true" />
<param name="resultFetchSize" value="100" />
<param name="extractorPoolSize" value="3" />
<param name="extractorTimeout" value="100" />
<param name="extractorBackLogSize" value="100" />
<!-- needed to highlight the searched term -->
<param name="supportHighlighting" value="true"/>
<!-- custom provider for getting an HTML excerpt in a query result with rep:excerpt() -->
<param name="excerptProviderClass" value="info.magnolia.jackrabbit.lucene.SearchHTMLExcerpt"/>
</SearchIndex>
<WorkspaceSecurity>
<AccessControlProvider class="info.magnolia.cms.core.MagnoliaAccessProvider" />
</WorkspaceSecurity>
</Workspace>
<Versioning rootPath="${rep.home}/version">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/workspaces/version" />
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.MySqlPersistenceManager">
<param name="dataSourceName" value="magnolia"/>
<param name="schemaObjectPrefix" value="version_" />
</PersistenceManager>
</Versioning>
</Repository>
37 changes: 37 additions & 0 deletions magnolia-ce-mysql/files/setenv.sh
@@ -0,0 +1,37 @@
# Container settings - Adjust those default settings according to your needs

#
# JVM settings
#
export CATALINA_OPTS="$CATALINA_OPTS \
-server \
-Djava.security.egd=file:/dev/./urandom \
-Djava.awt.headless=true"

#
# JVM memory settings
#
export CATALINA_OPTS="$CATALINA_OPTS \
-Xms64M \
-Xmx2048M"


#
# Magnolia
#
export CATALINA_OPTS="$CATALINA_OPTS \
-Dmagnolia.develop=$DEVELOP_MODE \
-Dmagnolia.home=/var/lib/magnolia \
-Dmagnolia.bootstrap.authorInstance=$IS_AUTHOR\
-Dmagnolia.update.auto=true"

#
# Database settings
#
export CATALINA_OPTS="$CATALINA_OPTS \
-Dmagnolia.repositories.jackrabbit.config=/etc/magnolia/repo.xml \
-Ddb.address=$DB_ADDRESS \
-Ddb.port=$DB_PORT \
-Ddb.schema=$DB_SCHEMA \
-Ddb.username=$DB_USERNAME \
-Ddb.password=$DB_PASSWORD"
3 changes: 3 additions & 0 deletions magnolia-ce-mysql/push.sh
@@ -0,0 +1,3 @@
#!/bin/bash
docker push magnolia/magnolia-ce-pgsql:$1-$2-$3${4:+-$4}