Skip to content

Commit

Permalink
feat: use Postgres database by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasmith committed Sep 23, 2023
1 parent e9b9155 commit 66bf214
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
11 changes: 5 additions & 6 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 3 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-docker-compose</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>

<dependency>
<groupId>org.javamoney</groupId>
Expand Down Expand Up @@ -117,8 +108,8 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -155,7 +146,7 @@

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mariadb</artifactId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 7 additions & 3 deletions src/test/java/net/anatolich/iris/ContainersConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 66bf214

Please sign in to comment.