springtainer-redis
Dependency
<dependency>
<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-redis</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
Configuration
Properties consumed (in bootstrap.properties
):
embedded.container.redis.enabled
(default istrue
)embedded.container.redis.startup-timeout
(default is30
)embedded.container.redis.docker-image
(default isredis:6.0.5-alpine
)embedded.container.redis.port
(default is6379
)
Properties provided (in application-it.properties
):
embedded.container.redis.host
embedded.container.redis.port
Example for minimal configuration in application-it.properties
:
spring.redis.host=${embedded.container.redis.host}
spring.redis.port=${embedded.container.redis.port}
Logging
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" />
Labels
The container exports multiple labels to analyze running springtainers:
SPRINGTAINER_SERVICE=redis
SPRINGTAINER_IMAGE=${embedded.container.redis.docker-image}
SPRINGTAINER_STARTED=$currentTimestamp