Commit 9b0d04c3f1647a730de0ee17e83d48d12c1cf8b4

Authored by hausdoerfer
1 parent 20f8f0f1

add volume to database and move module to docker compose

docker/docker-compose.yml
... ... @@ -9,10 +9,15 @@ services:
9 9 - "8080:8080"
10 10 - "8787:8787"
11 11 - "9990:9990"
  12 + environment:
  13 + POSTGRES_USER: beuthbot_app
  14 + POSTGRES_PASSWORD: VhS7WPVpdYEHYLpf
  15 + POSTGRES_DB: beuthbot
12 16 volumes:
13 17 - ./wildfly/volumes/deployments/:/opt/jboss/wildfly/standalone/deployments/
14 18 - ./wildfly/volumes/logs/:/opt/jboss/wildfly/standalone/log/
15 19 - ./wildfly/volumes/conf/:/opt/jboss/wildfly/standalone/conf/
  20 + - ./wildfly/volumes/modules/org/postgres/main/:/opt/jboss/wildfly/modules/org/postgres/main/
16 21 links:
17 22 - rasa-server
18 23 - postgres-db
... ... @@ -30,14 +35,17 @@ services:
30 35 command: python -m rasa_nlu.server -c config/chatbot_config.json --server_model_dirs=default
31 36  
32 37 postgres-db:
33   - container_name: chatbot-postgres
34 38 image: postgres
35 39 ports:
36   - - "5432:5432"
  40 + - "5432:5432"
37 41 environment:
38   - POSTGRES_USER: beuthbot_app
  42 + POSTGRES_USER: beuthbotuser
39 43 POSTGRES_PASSWORD: VhS7WPVpdYEHYLpf
40   - POSTGRES_DB: beuthbot
  44 + POSTGRES_DB: beuthbotdb
  45 + volumes:
  46 + # - ./postgresql/etc/postgresql.conf:/etc/postgresql.conf
  47 + - ./postgresql/var/lib/postgresql/data:/var/lib/postgresql/data
  48 + # command: postgres -c config_file=/etc/postgresql.conf
41 49  
42 50 adminer:
43 51 container_name: adminer_dbmanagement
... ...
docker/wildfly/Dockerfile
... ... @@ -2,14 +2,8 @@ FROM jboss/wildfly:10.1.0.Final
2 2 RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin
3 3 COPY standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml
4 4  
5   -#USER root
6   -
7   -ADD modules/org/postgres/main/postgresql-42.1.4.jar /opt/jboss/wildfly/modules/org/postgres/main/postgresql-42.1.4.jar
8   -ADD modules/org/postgres/main/module.xml /opt/jboss/wildfly/modules/org/postgres/main/module.xml
9 5  
10   -#ADD modules/postgresql-42.1.4.jar /opt/jboss/wildfly/modules/system/layers/base/org/postgres/main/postgresql-42.1.4.jar
11   -#ADD modules/module.xml /opt/jboss/wildfly/modules/system/layers/base/org/postgres/main/module.xml
  6 +#USER root
12 7  
13   -#RUN /subsystem=datasources/jdbc-driver=org.postgresql:add(driver-name=postgresql, driver-module-name=postgresql, driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)
14   -#RUN /subsystem=datasources/xa-data-source=postgresql:add(driver-name=postgresql, jndi-name="java:jboss/datasources/PostgreSQLDS", enabled=true)
15   -#RUN /subsystem=datasources/xa-data-source=postgresql/xa-datasource-properties=URL:add(value="jdbc:postgresql://localhost:5432/beuthbot")
  8 +#ADD modules/org/postgres/main/postgresql-42.1.4.jar /opt/jboss/wildfly/modules/org/postgres/main/postgresql-42.1.4.jar
  9 +#ADD modules/org/postgres/main/module.xml /opt/jboss/wildfly/modules/org/postgres/main/module.xml
16 10 \ No newline at end of file
... ...
docker/wildfly/standalone.xml
... ... @@ -421,11 +421,11 @@
421 421 <subsystem xmlns="urn:jboss:domain:datasources:2.0">
422 422 <datasources>
423 423 <datasource jta="true" jndi-name="java:jboss/datasources/PostgreSQLDS" pool-name="PostgreSQLDS" enabled="true" use-java-context="true">
424   - <connection-url>jdbc:postgresql://postgres-db:5432/beuthbot</connection-url>
425   - <connection-property name="databaseName">beuthbot</connection-property>
  424 + <connection-url>jdbc:postgresql://localhost:5432/beuthbotdb</connection-url>
  425 + <connection-property name="databaseName">beuthbotdb</connection-property>
426 426 <driver>postgresql</driver>
427 427 <security>
428   - <user-name>beuthbot_app</user-name>
  428 + <user-name>beuthbotuser</user-name>
429 429 <password>VhS7WPVpdYEHYLpf</password>
430 430 </security>
431 431 <pool>
... ... @@ -440,27 +440,6 @@
440 440 </validation>
441 441 </datasource>
442 442  
443   - <xa-datasource jndi-name="java:jboss/datasources/PgDsXaWildFlyDb" pool-name="PgDsXaWildflyDb" enabled="true" use-java-context="true">
444   - <driver>postgresql</driver>
445   - <xa-datasource-property name="ServerName">postgres-db</xa-datasource-property>
446   - <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
447   - <xa-datasource-property name="DatabaseName">beuthbot</xa-datasource-property>
448   - <xa-pool>
449   - <min-pool-size>5</min-pool-size>
450   - <initial-pool-size>5</initial-pool-size>
451   - <max-pool-size>100</max-pool-size>
452   - <prefill>true</prefill>
453   - </xa-pool>
454   - <validation>
455   - <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
456   - <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
457   - </validation>
458   - <security>
459   - <user-name>beuthbot_app</user-name>
460   - <password>VhS7WPVpdYEHYLpf</password>
461   - </security>
462   - </xa-datasource>
463   -
464 443 <drivers>
465 444 <driver name="postgresql" module="org.postgres">
466 445 <driver-class>org.postgresql.Driver</driver-class>
... ...
docker/wildfly/volumes/modules/org/postgres/main/module.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<module xmlns="urn:jboss:module:1.1" name="org.postgres">
  3 + <resources>
  4 + <!--https://jdbc.postgresql.org/download.html-->
  5 + <resource-root path="postgresql-42.1.4.jar"/>
  6 + </resources>
  7 + <dependencies>
  8 + <module name="javax.api"/>
  9 + <module name="javax.transaction.api"/>
  10 + <module name="javax.servlet.api" optional="true"/>
  11 + </dependencies>
  12 +</module>
0 13 \ No newline at end of file
... ...