diff --git a/.gitignore b/.gitignore
index a694146..b9ed39a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
-*.xpr
\ No newline at end of file
+*.xpr
+secrets/
+mysql-connector-java*.jar
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index d445848..9f6a09f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,6 +2,7 @@ FROM tomcat:alpine
ARG tag
ARG build
+ARG flavour
RUN \
cd /tmp \
@@ -13,8 +14,10 @@ RUN \
&& unzip $build.zip \
&& cd $build \
&& unzip orbeon.war \
- && rm -rf /usr/local/tomcat/webapps \
- && mkdir -p /usr/local/tomcat/webapps/ROOT \
- && mv WEB-INF/ /usr/local/tomcat/webapps/ROOT \
+ && mkdir -p /usr/local/orbeon \
+ && mv WEB-INF/ /usr/local/orbeon \
&& cd \
- && rm -rf /tmp/orbeon
\ No newline at end of file
+ && rm -rf /tmp/orbeon
+
+COPY ./$flavour/tomcat/ /usr/local/tomcat/
+COPY ./$flavour/orbeon/ /usr/local/orbeon/
\ No newline at end of file
diff --git a/Dockerfile-mysql b/Dockerfile-mysql
new file mode 100644
index 0000000..6751fc7
--- /dev/null
+++ b/Dockerfile-mysql
@@ -0,0 +1,3 @@
+FROM mysql
+
+COPY ./mysql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
diff --git a/docker-compose-ce.yml b/docker-compose-ce.yml
index 0df0977..a613d80 100644
--- a/docker-compose-ce.yml
+++ b/docker-compose-ce.yml
@@ -1,4 +1,4 @@
-version: "3"
+version: "3.3"
services:
servlet:
build:
diff --git a/docker-compose-embedded-exist.yml b/docker-compose-embedded-exist.yml
new file mode 100644
index 0000000..07fd86a
--- /dev/null
+++ b/docker-compose-embedded-exist.yml
@@ -0,0 +1,6 @@
+version: "3.3"
+services:
+ servlet:
+ build:
+ args:
+ flavour: "embedded-exist"
diff --git a/docker-compose-mysql.yml b/docker-compose-mysql.yml
new file mode 100644
index 0000000..f3a1aa0
--- /dev/null
+++ b/docker-compose-mysql.yml
@@ -0,0 +1,27 @@
+version: "3.3"
+services:
+ servlet:
+ depends_on:
+ - db
+ build:
+ args:
+ flavour: "mysql"
+ networks:
+ - net
+ db:
+ build:
+ context: .
+ dockerfile: Dockerfile-mysql
+ image: mysql-orbeon
+ restart: always
+ environment:
+ MYSQL_ROOT_PASSWORD: osuaL4Ru
+ MYSQL_DATABASE: orbeon
+ MYSQL_USER: orbeon
+ MYSQL_PASSWORD: osuaL4Ru
+ networks:
+ - net
+
+networks:
+ net:
+
diff --git a/docker-compose-pe.yml b/docker-compose-pe.yml
index 5712b98..d3b9f31 100644
--- a/docker-compose-pe.yml
+++ b/docker-compose-pe.yml
@@ -9,11 +9,11 @@ services:
image: orbeon-pe
secrets:
- source: license
- target: /usr/local/tomcat/webapps/ROOT/WEB-INF/resources/config/license.xml
+ target: /usr/local/orbeon/WEB-INF/resources/config/license.xml
ports:
- "8080:8080"
secrets:
license:
- file: ~/.orbeon/license.xml
+ file: secrets/license.xml
diff --git a/embedded-exist/tomcat/conf/Catalina/localhost/orbeon.xml b/embedded-exist/tomcat/conf/Catalina/localhost/orbeon.xml
new file mode 100644
index 0000000..2432fe2
--- /dev/null
+++ b/embedded-exist/tomcat/conf/Catalina/localhost/orbeon.xml
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/mysql/docker-entrypoint-initdb.d/mysql-2017_2.sql b/mysql/docker-entrypoint-initdb.d/mysql-2017_2.sql
new file mode 100644
index 0000000..16e2bcb
--- /dev/null
+++ b/mysql/docker-entrypoint-initdb.d/mysql-2017_2.sql
@@ -0,0 +1,111 @@
+USE orbeon;
+set sql_mode='ALLOW_INVALID_DATES';
+
+ALTER DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+CREATE TABLE orbeon_form_definition (
+ created TIMESTAMP(6) ,
+ last_modified_time TIMESTAMP(6) ,
+ last_modified_by VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ app VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form_version INT NOT NULL,
+ form_metadata VARCHAR(4000) COLLATE utf8_bin ,
+ deleted CHAR(1) COLLATE utf8_bin NOT NULL,
+ xml MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_form_definition_attach (
+ created TIMESTAMP(6) ,
+ last_modified_time TIMESTAMP(6) ,
+ last_modified_by VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ app VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form_version INT NOT NULL,
+ deleted CHAR(1) COLLATE utf8_bin NOT NULL,
+ file_name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ file_content LONGBLOB
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_form_data (
+ id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
+ created TIMESTAMP(6) ,
+ last_modified_time TIMESTAMP(6) ,
+ last_modified_by VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ username VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ groupname VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ organization_id INT ,
+ app VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form_version INT NOT NULL,
+ document_id VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ draft CHAR(1) COLLATE utf8_bin NOT NULL,
+ deleted CHAR(1) COLLATE utf8_bin NOT NULL,
+ xml MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_form_data_attach (
+ created TIMESTAMP(6) ,
+ last_modified_time TIMESTAMP(6) ,
+ last_modified_by VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ username VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ groupname VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ organization_id INT ,
+ app VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ form_version INT NOT NULL,
+ document_id VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ draft CHAR(1) COLLATE utf8_bin NOT NULL,
+ deleted CHAR(1) COLLATE utf8_bin NOT NULL,
+ file_name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ file_content LONGBLOB
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_form_data_lease (
+ document_id VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL PRIMARY KEY,
+ username VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ,
+ groupname VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ expiration TIMESTAMP(6) NOT NULL
+);
+
+CREATE TABLE orbeon_organization (
+ id INT NOT NULL,
+ depth INT NOT NULL,
+ pos INT NOT NULL,
+ name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_seq (
+ val INT PRIMARY KEY AUTO_INCREMENT NOT NULL
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_i_current (
+ data_id INT NOT NULL,
+ created TIMESTAMP(6) NOT NULL,
+ last_modified_time TIMESTAMP(6) NOT NULL,
+ last_modified_by VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ username VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ groupname VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin ,
+ organization_id INT ,
+ app VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ form VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ form_version INT NOT NULL,
+ document_id VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ draft CHAR(1) NOT NULL,
+ FOREIGN KEY (data_id) REFERENCES orbeon_form_data(id)
+) ENGINE = InnoDB;
+
+CREATE TABLE orbeon_i_control_text (
+ data_id INT NOT NULL,
+ pos INT NOT NULL,
+ control VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
+ val MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
+ FOREIGN KEY (data_id) REFERENCES orbeon_form_data(id)
+) ENGINE = InnoDB;
+
+CREATE INDEX orbeon_form_definition_i1 ON orbeon_form_definition (app, form);
+CREATE INDEX orbeon_form_definition_att_i1 ON orbeon_form_definition_attach (app, form, file_name);
+CREATE INDEX orbeon_from_data_i1 ON orbeon_form_data (app, form, document_id, draft);
+CREATE INDEX orbeon_from_data_attach_i1 ON orbeon_form_data_attach (app, form, document_id, file_name, draft);
+CREATE UNIQUE INDEX orbeon_i_current_i1 ON orbeon_i_current (data_id, draft);
+CREATE INDEX orbeon_i_control_text_i1 ON orbeon_i_control_text (data_id);
diff --git a/mysql/orbeon/WEB-INF/resources/config/properties-local.xml b/mysql/orbeon/WEB-INF/resources/config/properties-local.xml
new file mode 100644
index 0000000..b6cf249
--- /dev/null
+++ b/mysql/orbeon/WEB-INF/resources/config/properties-local.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
diff --git a/mysql/tomcat/conf/Catalina/localhost/orbeon.xml b/mysql/tomcat/conf/Catalina/localhost/orbeon.xml
new file mode 100644
index 0000000..1a95329
--- /dev/null
+++ b/mysql/tomcat/conf/Catalina/localhost/orbeon.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
\ No newline at end of file