Skip to content

Commit

Permalink
Add Docker configuration according to https://github.com/goldmann/wil…
Browse files Browse the repository at this point in the history
  • Loading branch information
oskopek committed Sep 26, 2014
1 parent 1ed8e19 commit 8fa5bc4
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM jboss/wildfly
ADD docker/org /opt/wildfly/modules/org/
ADD deployments/ROOT.war /opt/wildfly/standalone/deployments/
ADD docker/add-datasource.sh /opt/wildfly/bin/
RUN /opt/wildfly/bin/add-datasource.sh
40 changes: 40 additions & 0 deletions docker/add-datasource.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/augtool -LAsf

#<subsystem xmlns="urn:jboss:domain:datasources:2.0">
# <datasources>
# <datasource jndi-name="java:jboss/datasources/MySQLDS" pool-name="MySQLDS" enabled="true" use-java-context="true">
# <connection-url>jdbc:mariadb://${env.MARIADB_}:3306/testdb?useUnicode=yes&amp;characterEncoding=UTF-8</connection-url>
# <driver>mariadb</driver>
# <security>
# <user-name>root</user-name>
# <password>mysqlPassword</password>
# </security>
# </datasource>
# <drivers>
# <driver name="mariadb" module="org.mariadb.jdbc">
# <xa-datasource-class>org.mariadb.jdbc.MySQLDataSource</xa-datasource-class>
# </driver>
# </drivers>
# </datasources>
#</subsystem>

set /augeas/load/Xml/lens Xml.lns
set /augeas/load/Xml/incl[2] /opt/wildfly/standalone/configuration/standalone.xml
load
defvar subsystem "/files/opt/wildfly/standalone/configuration/standalone.xml/server/profile/subsystem[#attribute/xmlns='urn:jboss:domain:datasources:2.0']"
set $subsystem/datasources/datasource[last()+1]/#attribute/jndi-name "java:jboss/datasources/MySQLDS"
defvar ds $subsystem/datasources/datasource[last()]
set $ds/#attribute/pool-name "MySQLDS"
set $ds/#attribute/enabled "true"
set $ds/#attribute/use-java-context "true"
set $ds/connection-url/#text "jdbc:mariadb://${env.MARIADB_PORT_3306_TCP_ADDR}:3306/testdb?useUnicode=yes&amp;characterEncoding=UTF-8"
set $ds/driver/#text "mariadb"
set $ds/security/user-name/#text "root"
set $ds/security/password/#text "mysqlPassword"
set $subsystem/datasources/drivers/driver[last()+1]/#attribute/name "mariadb"
defvar dr $subsystem/datasources/drivers/driver[last()]
set $dr/#attribute/module "org.mariadb.jdbc"
set $dr/xa-datasource-class/#text "org.mariadb.jdbc.MySQLDataSource"
save

print /augeas//error
Binary file not shown.
35 changes: 35 additions & 0 deletions docker/org/mariadb/jdbc/main/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2010, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<module xmlns="urn:jboss:module:1.3" name="org.mariadb.jdbc">

<resources>
<resource-root path="mariadb-java-client-1.1.7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>

0 comments on commit 8fa5bc4

Please sign in to comment.