diff --git a/.gitignore b/.gitignore index cd74a91..ae41428 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ build bin -# Ignore mariadb volume directory +# Ignore docker volume directory mariadb diff --git a/docker-compose.yml b/docker-compose.yml index 84b45ae..ee1dc89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,11 @@ services: - ./build/libs/:/opt/jboss/wildfly/standalone/deployments/ environment: - WILDFLY_PASSWORD=password + - DB_PORT=3306 + - DB_HOST=mariadb + depends_on: + mariadb: + condition: service_healthy restart: always mariadb: @@ -27,6 +32,14 @@ services: - 3306:3306 volumes: - ./mariadb/:/var/lib/mysql/ + healthcheck: + test: + [ + "CMD-SHELL", + 'mysqladmin -p$$MYSQL_ROOT_PASSWORD -h localhost ping | grep "mysqld is alive" || exit 1', + ] + interval: 2s + retries: 10 restart: always volumes: