Skip to content

Commit 3eb6206

Browse files
committed
Docker Modeshape Repo in MySQL
Signed-off-by: Kevin Olotu <kevin.olotu@bosch.io>
1 parent a1c5455 commit 3eb6206

File tree

4 files changed

+93
-2
lines changed

4 files changed

+93
-2
lines changed

docker/Repository_Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ RUN apt-get install -y python3 python3-yaml wget
1010
RUN wget -P /code/lib https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.3.0/mariadb-java-client-2.3.0.jar
1111
ADD ./${JAR_FILE} /code/infomodelrepository.jar
1212
ADD ./docker/scripts/run.py /code
13-
ADD ./docker/mysql_spring.yml /code
13+
ADD ./docker/config/application.yml /code/config/
14+
ADD ./docker/config/vorto-repository-config-mysql.json /code/config/
1415
ADD ./docker/scripts/wait-for-it.sh /code
1516
RUN chmod +x wait-for-it.sh
1617
CMD ["/bin/bash", "/code/wait-for-it.sh", "-t", "120", "db:3306", "--", "/usr/bin/python3", "/code/run.py"]

docker/config/application.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright (c) 2020 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Eclipse Public License 2.0 which is available at
9+
# https://www.eclipse.org/legal/epl-2.0
10+
#
11+
# SPDX-License-Identifier: EPL-2.0
12+
#
13+
14+
server:
15+
contextPath: /
16+
17+
repo:
18+
configFile: vorto-repository-config-mysql.json
19+
attachment:
20+
allowed:
21+
extension:
22+
23+
spring:
24+
datasource:
25+
testWhileIdle: true
26+
timeBetweenEvictionRunsMillis: 60000
27+
wait_timeout: 180
28+
validationInterval: 60
29+
validationQuery: SELECT 1
30+
driver-class-name: org.mariadb.jdbc.Driver
31+
url:
32+
username:
33+
password:
34+
jpa:
35+
show-sql: false
36+
generate-ddl: true
37+
hibernate:
38+
ddl-auto: none
39+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "vorto",
3+
"workspaces": {
4+
"default": "default",
5+
"allowCreation": true
6+
},
7+
"security": {
8+
"anonymous": {
9+
"roles": [
10+
"readonly",
11+
"readwrite",
12+
"admin"
13+
],
14+
"useOnFailedLogin": false
15+
},
16+
"providers": [
17+
{
18+
"name": "Spring Security",
19+
"classname": "org.eclipse.vorto.repository.core.security.SpringSecurityProvider"
20+
}
21+
]
22+
},
23+
"storage": {
24+
"persistence": {
25+
"type": "db",
26+
"driver": "org.mariadb.jdbc.Driver",
27+
"connectionUrl": "${spring.datasource.url}",
28+
"username": "${spring.datasource.username}",
29+
"password": "${spring.datasource.password}"
30+
},
31+
"binaryStorage": {
32+
"type": "database",
33+
"driverClass": "org.mariadb.jdbc.Driver",
34+
"url": "${spring.datasource.url}",
35+
"username": "${spring.datasource.username}",
36+
"password": "${spring.datasource.password}"
37+
}
38+
},
39+
"sequencing": {
40+
"removeDerivedContentWithOriginal": false,
41+
"sequencers": {
42+
"Vorto Sequencer": {
43+
"classname": "org.eclipse.vorto.repository.core.impl.ModelSequencer",
44+
"pathExpressions": [
45+
"default://(*.type|*.fbmodel|*.infomodel|*.mapping)/jcr:content[@jcr:data]"
46+
]
47+
}
48+
}
49+
}
50+
}

docker/scripts/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ def main():
129129
sys.exit(1)
130130

131131
if datasource == "mysql":
132-
with open("./mysql_spring.yml") as yaml_file:
132+
with open("./config/application.yml") as yaml_file:
133133
yaml_data = yaml.safe_load(yaml_file.read())
134134
spring_application.update(yaml_data)
135135
args.update({"spring.datasource.url": getenv("MYSQL_URL", "jdbc:mysql://db:3306/vorto")})
136136
args.update({"spring.datasource.username": getenv("MYSQL_USER", "root")})
137137
args.update({"spring.datasource.password": getenv("MYSQL_ROOT_PASSWORD")})
138+
args.update({"spring.datasource.driver-class-name": "org.mariadb.jdbc.Driver"})
138139
#generator settings
139140
if is_generator:
140141
if getenv("SERVICE_URL"):

0 commit comments

Comments
 (0)