feat: connection de wildly à mariadb

This commit is contained in:
Laureηt 2022-04-21 15:35:45 +02:00
parent 0345b6826a
commit 977aab3335
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
2 changed files with 24 additions and 2 deletions

View file

@ -23,8 +23,8 @@ dependencies {
// Pour pouvoir parser le JSON
implementation 'com.google.code.gson:gson:2.8.6'
// implementation 'org.hibernate:hibernate-core:5.4.30.Final'
// implementation 'mysql:mysql-connector-java:8.0.24'
implementation 'org.hibernate:hibernate-core:5.4.30.Final'
implementation 'mysql:mysql-connector-java:8.0.24'
// des fonctions pratiques
implementation 'org.apache.commons:commons-lang3:3.0'

View file

@ -11,9 +11,31 @@ services:
volumes:
- ./build/libs/:/opt/jboss/wildfly/standalone/deployments/
environment:
- WILDFLY_USERNAME=admin
- WILDFLY_PASSWORD=password
- DB_PORT=3306
- DB_HOST=mariadb
command: >
bash -c '
(
sleep 15 &&
/opt/jboss/wildfly/bin/jboss-cli.sh \
--connect controller=127.0.0.1 \
--command=" \
data-source add \
--jndi-name=java:/MySqlDS \
--name=MySQLDS \
--connection-url=jdbc:mysql://$$DB_HOST:$$DB_PORT/mydatabase \
--driver-name=backend.war_com.mysql.cj.jdbc.Driver_8_0 \
--user-name=$$WILDFLY_USERNAME \
--password=$$WILDFLY_PASSWORD \
"
)&
/opt/jboss/wildfly/bin/add-user.sh admin password --silent &&
/opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0'
depends_on:
mariadb:
condition: service_healthy