Commit 9b0d04c3f1647a730de0ee17e83d48d12c1cf8b4
1 parent
20f8f0f1
add volume to database and move module to docker compose
Showing
4 changed files
with
30 additions
and
37 deletions
docker/docker-compose.yml
@@ -9,10 +9,15 @@ services: | @@ -9,10 +9,15 @@ services: | ||
9 | - "8080:8080" | 9 | - "8080:8080" |
10 | - "8787:8787" | 10 | - "8787:8787" |
11 | - "9990:9990" | 11 | - "9990:9990" |
12 | + environment: | ||
13 | + POSTGRES_USER: beuthbot_app | ||
14 | + POSTGRES_PASSWORD: VhS7WPVpdYEHYLpf | ||
15 | + POSTGRES_DB: beuthbot | ||
12 | volumes: | 16 | volumes: |
13 | - ./wildfly/volumes/deployments/:/opt/jboss/wildfly/standalone/deployments/ | 17 | - ./wildfly/volumes/deployments/:/opt/jboss/wildfly/standalone/deployments/ |
14 | - ./wildfly/volumes/logs/:/opt/jboss/wildfly/standalone/log/ | 18 | - ./wildfly/volumes/logs/:/opt/jboss/wildfly/standalone/log/ |
15 | - ./wildfly/volumes/conf/:/opt/jboss/wildfly/standalone/conf/ | 19 | - ./wildfly/volumes/conf/:/opt/jboss/wildfly/standalone/conf/ |
20 | + - ./wildfly/volumes/modules/org/postgres/main/:/opt/jboss/wildfly/modules/org/postgres/main/ | ||
16 | links: | 21 | links: |
17 | - rasa-server | 22 | - rasa-server |
18 | - postgres-db | 23 | - postgres-db |
@@ -30,14 +35,17 @@ services: | @@ -30,14 +35,17 @@ services: | ||
30 | command: python -m rasa_nlu.server -c config/chatbot_config.json --server_model_dirs=default | 35 | command: python -m rasa_nlu.server -c config/chatbot_config.json --server_model_dirs=default |
31 | 36 | ||
32 | postgres-db: | 37 | postgres-db: |
33 | - container_name: chatbot-postgres | ||
34 | image: postgres | 38 | image: postgres |
35 | ports: | 39 | ports: |
36 | - - "5432:5432" | 40 | + - "5432:5432" |
37 | environment: | 41 | environment: |
38 | - POSTGRES_USER: beuthbot_app | 42 | + POSTGRES_USER: beuthbotuser |
39 | POSTGRES_PASSWORD: VhS7WPVpdYEHYLpf | 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 | adminer: | 50 | adminer: |
43 | container_name: adminer_dbmanagement | 51 | container_name: adminer_dbmanagement |
docker/wildfly/Dockerfile
@@ -2,14 +2,8 @@ FROM jboss/wildfly:10.1.0.Final | @@ -2,14 +2,8 @@ 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 | 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 | \ No newline at end of file | 10 | \ No newline at end of file |
docker/wildfly/standalone.xml
@@ -421,11 +421,11 @@ | @@ -421,11 +421,11 @@ | ||
421 | <subsystem xmlns="urn:jboss:domain:datasources:2.0"> | 421 | <subsystem xmlns="urn:jboss:domain:datasources:2.0"> |
422 | <datasources> | 422 | <datasources> |
423 | <datasource jta="true" jndi-name="java:jboss/datasources/PostgreSQLDS" pool-name="PostgreSQLDS" enabled="true" use-java-context="true"> | 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 | <driver>postgresql</driver> | 426 | <driver>postgresql</driver> |
427 | <security> | 427 | <security> |
428 | - <user-name>beuthbot_app</user-name> | 428 | + <user-name>beuthbotuser</user-name> |
429 | <password>VhS7WPVpdYEHYLpf</password> | 429 | <password>VhS7WPVpdYEHYLpf</password> |
430 | </security> | 430 | </security> |
431 | <pool> | 431 | <pool> |
@@ -440,27 +440,6 @@ | @@ -440,27 +440,6 @@ | ||
440 | </validation> | 440 | </validation> |
441 | </datasource> | 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 | <drivers> | 443 | <drivers> |
465 | <driver name="postgresql" module="org.postgres"> | 444 | <driver name="postgresql" module="org.postgres"> |
466 | <driver-class>org.postgresql.Driver</driver-class> | 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 | \ No newline at end of file | 13 | \ No newline at end of file |