Commit 8a9e8de41d2d07d5f0db22b2c6418fbc81a9cfb0
Merge branch 'persistence' of https://git.ziemers.de/edu/BeuthBot into persistence
Showing
3 changed files
with
50 additions
and
1 deletions
docker/wildfly/Dockerfile
1 | FROM jboss/wildfly:10.1.0.Final | 1 | FROM jboss/wildfly:10.1.0.Final |
2 | RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin | 2 | RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin |
3 | -COPY standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml | ||
4 | \ No newline at end of file | 3 | \ No newline at end of file |
4 | +COPY standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml | ||
5 | + | ||
6 | +#USER root | ||
7 | + | ||
8 | +ADD modules/postgresql-42.1.4.jar /opt/jboss/wildfly/modules/org/postgres/main/postgresql-42.1.4.jar | ||
9 | +ADD modules/module.xml /opt/jboss/wildfly/modules/org/postgres/main/module.xml | ||
10 | + | ||
11 | +#ADD modules/postgresql-42.1.4.jar /opt/jboss/wildfly/modules/system/layers/base/org/postgres/main/postgresql-42.1.4.jar | ||
12 | +#ADD modules/module.xml /opt/jboss/wildfly/modules/system/layers/base/org/postgres/main/module.xml | ||
13 | + | ||
14 | +#RUN /subsystem=datasources/jdbc-driver=org.postgresql:add(driver-name=postgresql, driver-module-name=postgresql, driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource) | ||
15 | +#RUN /subsystem=datasources/xa-data-source=postgresql:add(driver-name=postgresql, jndi-name="java:jboss/datasources/PostgreSQLDS", enabled=true) | ||
16 | +#RUN /subsystem=datasources/xa-data-source=postgresql/xa-datasource-properties=URL:add(value="jdbc:postgresql://localhost:5432/beuthbot") |
docker/wildfly/modules/module.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<module xmlns="urn:jboss:module:1.0" name="postgresql"> | ||
3 | + <resources> | ||
4 | + <!--https://jdbc.postgresql.org/download.html--> | ||
5 | + <resource-root path="postgresql-9.3-1104.jdbc41.jar"/> | ||
6 | + </resources> | ||
7 | + <dependencies> | ||
8 | + <module name="javax.api"/> | ||
9 | + <module name="javax.transaction.api"/> | ||
10 | + </dependencies> | ||
11 | +</module> | ||
0 | \ No newline at end of file | 12 | \ No newline at end of file |
docker/wildfly/standalone.xml
@@ -417,6 +417,32 @@ | @@ -417,6 +417,32 @@ | ||
417 | <client-config name="Standard-Client-Config"/> | 417 | <client-config name="Standard-Client-Config"/> |
418 | </subsystem> | 418 | </subsystem> |
419 | <subsystem xmlns="urn:jboss:domain:weld:3.0"/> | 419 | <subsystem xmlns="urn:jboss:domain:weld:3.0"/> |
420 | + | ||
421 | + <subsystem xmlns="urn:jboss:domain:datasources:2.0"> | ||
422 | + <datasources> | ||
423 | + <datasource jta="true" jndi-name="java:jboss/datasources/PostgreSQLDS" pool-name="postgresql" enabled="true" use-java-context="true"> | ||
424 | + <connection-url>jdbc:postgresql://localhost:5432/beuthbot</connection-url> | ||
425 | + <connection-property name="databaseName">beuthbot</connection-property> | ||
426 | + <driver>postgresql</driver> | ||
427 | + <security> | ||
428 | + <user-name>beuthbot_app</user-name> | ||
429 | + <password>VhS7WPVpdYEHYLpf</password> | ||
430 | + </security> | ||
431 | + <validation> | ||
432 | + <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/> | ||
433 | + <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/> | ||
434 | + </validation> | ||
435 | + </datasource> | ||
436 | + <drivers> | ||
437 | + <driver name="postgresql" module="postgresql"> | ||
438 | + <driver-class>org.postgresql.Driver</driver-class> | ||
439 | + <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> | ||
440 | + <datasource-class>org.postgresql.ds.PGSimpleDataSource</datasource-class> | ||
441 | + </driver> | ||
442 | + </drivers> | ||
443 | + </datasources> | ||
444 | + </subsystem> | ||
445 | + | ||
420 | </profile> | 446 | </profile> |
421 | 447 | ||
422 | <interfaces> | 448 | <interfaces> |