This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 25ccf643231d2f4d199d60bb98376fc0b4e9dedc Author: Benoit Tellier <[email protected]> AuthorDate: Fri Jun 25 14:36:37 2021 +0700 JAMES-3261 JPA app should also embed a MariaDB example --- server/apps/jpa-app/docker-compose.yml | 28 +++++++++++++++ .../james-database-mariadb.properties | 42 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/server/apps/jpa-app/docker-compose.yml b/server/apps/jpa-app/docker-compose.yml new file mode 100644 index 0000000..7f55cdb --- /dev/null +++ b/server/apps/jpa-app/docker-compose.yml @@ -0,0 +1,28 @@ +version: '3' + +# In order to start James JPA app on top of mariaDB: +# 1. Download the driver: `wget https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.2/mariadb-java-client-2.7.2.jar` +# 2. Generate the keystore with the default password `james72laBalle`: `keytool -genkey -alias james -keyalg RSA -keystore keystore` +# 3. Start MariaDB: `docker-compose up -d mariadb` +# 4. Start James: `docker-compose up james` + +services: + + james: + depends_on: + - mariadb + image: apache/james:jpa-latest + container_name: james + hostname: james.local + volumes: + - $PWD/mariadb-java-client-2.7.2.jar:/root/libs/mariadb-java-client-2.7.2.jar + - $PWD/sample-configuration/james-database-mariadb.properties:/root/conf/james-database.properties + - $PWD/keystore:/root/conf/keystore + + mariadb: + image: mariadb:10.6 + environment: + - MARIADB_ROOT_PASSWORD=test + - MARIADB_DATABASE=test + - MARIADB_USER=test + - MARIADB_PASSWORD=test \ No newline at end of file diff --git a/server/apps/jpa-app/sample-configuration/james-database-mariadb.properties b/server/apps/jpa-app/sample-configuration/james-database-mariadb.properties new file mode 100644 index 0000000..8060df0 --- /dev/null +++ b/server/apps/jpa-app/sample-configuration/james-database-mariadb.properties @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This template file can be used as example for James Server configuration +# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS + +# Read https://james.apache.org/server/config-system.html#james-database.properties for further details + +# Use derby as default +database.driverClassName=org.mariadb.jdbc.Driver +database.url=jdbc:mariadb://mariadb/test +database.username=test +database.password=test + +# Use streaming for Blobs +# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable +# it. +# +# See: +# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html #7.11. LOB Streaming +# +openjpa.streaming=false + +# Validate the data source before using it +# datasource.testOnBorrow=true +# datasource.validationQueryTimeoutSec=2 +# This is different per database. See https://stackoverflow.com/questions/10684244/dbcp-validationquery-for-different-databases#10684260 +# datasource.validationQuery=select 1 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
