From 66bf2147ede5370ed6506cfc95367124cc400e25 Mon Sep 17 00:00:00 2001 From: Dmytro Kovalchuk Date: Sat, 23 Sep 2023 22:10:55 +0300 Subject: [PATCH] feat: use Postgres database by default --- compose.yml | 11 +++++------ pom.xml | 15 +++------------ .../anatolich/iris/ContainersConfiguration.java | 10 +++++++--- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/compose.yml b/compose.yml index ef07799..aab2308 100644 --- a/compose.yml +++ b/compose.yml @@ -1,11 +1,10 @@ version: '3.8' services: database: - image: library/mariadb:10.8-focal + image: library/postgres:15-alpine ports: - - "3306:3306" + - "5432:5432" environment: - MYSQL_ROOT_PASSWORD: s3cr3t - MYSQL_USER: iris - MYSQL_PASSWORD: s3cr3t - MYSQL_DATABASE: iris + POSTGRES_USER: iris + POSTGRES_PASSWORD: s3cr3t + POSTGRES_DB: iris diff --git a/pom.xml b/pom.xml index 27ab9b5..e70a3af 100644 --- a/pom.xml +++ b/pom.xml @@ -53,20 +53,11 @@ org.springframework.boot spring-boot-starter-quartz - - org.springframework.boot - spring-boot-docker-compose - true - org.flywaydb flyway-core - - org.flywaydb - flyway-mysql - org.javamoney @@ -117,8 +108,8 @@ true - org.mariadb.jdbc - mariadb-java-client + org.postgresql + postgresql runtime @@ -155,7 +146,7 @@ org.testcontainers - mariadb + postgresql test diff --git a/src/test/java/net/anatolich/iris/ContainersConfiguration.java b/src/test/java/net/anatolich/iris/ContainersConfiguration.java index ddf4e79..36703a8 100644 --- a/src/test/java/net/anatolich/iris/ContainersConfiguration.java +++ b/src/test/java/net/anatolich/iris/ContainersConfiguration.java @@ -3,14 +3,18 @@ import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.context.annotation.Bean; -import org.testcontainers.containers.MariaDBContainer; +import org.testcontainers.containers.PostgreSQLContainer; @TestConfiguration(proxyBeanMethods = false) public class ContainersConfiguration { @Bean @ServiceConnection - public MariaDBContainer mariaDBContainer() { - return new MariaDBContainer<>("mariadb:10.8-focal"); + public PostgreSQLContainer mariaDBContainer() { + return new PostgreSQLContainer<>("postgres:15-alpine") + .withUsername("iris") + .withPassword("s3cr3t") + .withDatabaseName("iris") + .withReuse(true); } }