<dependency>
<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-mongodb</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
Properties consumed (in bootstrap.properties
):
embedded.container.mongodb.enabled
(default is true
)embedded.container.mongodb.startup-timeout
(default is 30
)embedded.container.mongodb.docker-image
(default is mongo:4.2.24
)embedded.container.mongodb.port
(default is 27017
)Properties provided (in application-it.properties
):
embedded.container.mongodb.host
embedded.container.mongodb.port
Example for minimal configuration in application-it.properties
:
spring.data.mongodb.uri=mongodb://${embedded.container.mongodb.host}:${embedded.container.mongodb.port}/test
To reduce logging insert this into the logback-configuration:
<!-- Springtainer -->
<logger name="com.github.dockerjava.jaxrs" level="WARN" />
<logger name="com.github.dockerjava.core.command" level="WARN" />
<logger name="org.apache.http" level="WARN" />
The container exports multiple labels to analyze running springtainers:
SPRINGTAINER_SERVICE=mongodb
SPRINGTAINER_IMAGE=${embedded.container.mongodb.docker-image}
SPRINGTAINER_STARTED=$currentTimestamp