Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/springtainer/springtainer-mysql

MySQL as docker-container for springboot testing
https://github.com/springtainer/springtainer-mysql

mysql spring spring-boot testcontainers testing

Last synced: about 1 month ago
JSON representation

MySQL as docker-container for springboot testing

Awesome Lists containing this project

README

        

# springtainer-mysql

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.avides.springboot.springtainer/springtainer-mysql/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.avides.springboot.springtainer/springtainer-mysql)
[![Build](https://github.com/springtainer/springtainer-mysql/workflows/release/badge.svg)](https://github.com/springtainer/springtainer-mysql/actions)
[![Nightly build](https://github.com/springtainer/springtainer-mysql/workflows/nightly/badge.svg)](https://github.com/springtainer/springtainer-mysql/actions)
[![Coverage report](https://sonarcloud.io/api/project_badges/measure?project=springtainer_springtainer-mysql&metric=coverage)](https://sonarcloud.io/dashboard?id=springtainer_springtainer-mysql)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=springtainer_springtainer-mysql&metric=alert_status)](https://sonarcloud.io/dashboard?id=springtainer_springtainer-mysql)
[![Technical dept](https://sonarcloud.io/api/project_badges/measure?project=springtainer_springtainer-mysql&metric=sqale_index)](https://sonarcloud.io/dashboard?id=springtainer_springtainer-mysql)

### Dependency

```xml

com.avides.springboot.springtainer
springtainer-mysql
1.4.0
test

```

### Configuration

Properties consumed (in `bootstrap.properties`):

- `embedded.container.mysql.enabled` (default is `true`)
- `embedded.container.mysql.startup-timeout` (default is `30`)
- `embedded.container.mysql.docker-image` (default is `mysql:8.0.32`)
- `embedded.container.mysql.port` (default is `3306`)
- `embedded.container.mysql.root-password` (default is `root`)
- `embedded.container.mysql.database-name` (default is `embeddedMySqlDb`)
- `embedded.container.mysql.database-charset` (default is `utf8mb4`)

Properties provided (in `application-it.properties`):

- `embedded.container.mysql.url` (an alias for `embedded.container.mysql.jdbc-url`)
- `embedded.container.mysql.jdbc-url`
- `embedded.container.mysql.r2dbc-url`
- `embedded.container.mysql.host`
- `embedded.container.mysql.port`

Example for minimal configuration in `application-it.properties`:

```
spring.datasource.url=${embedded.container.mysql.url}
spring.datasource.username=root
spring.datasource.password=${embedded.container.mysql.root-password}
```

## Logging

To reduce logging insert this into the logback-configuration:

```xml

```

## Labels

The container exports multiple labels to analyze running springtainers:

- `SPRINGTAINER_SERVICE=mysql`
- `SPRINGTAINER_IMAGE=${embedded.container.mysql.docker-image}`
- `SPRINGTAINER_STARTED=$currentTimestamp`