This is an rather minimalism Java Spring Boot Demo application illustrating external configuration using different methods in a Docker deployment (see Showcased for more information).
Additionally, you can spin up a minimal monitoring setup with preconfigured Prometheus and Grafana services including metrics from the JVM, your hosts and your docker container. The stack itself is deployed as docker container so there is no pollution of your system.
There is also a branch for the spring-boot 1.4 release (not fully equivalent)
- Docker
- Docker-compose
- default port 8080 for the application
- port 3000 and 9090 for Grafana and Prometheus
- port 9100 and 9200 for NodeExporter and cAdvisor
If you want to build the application without Docker:
- Java JDK >1.8
- Maven
Clone or download this repository and cd into this folder.
docker build -f Dockerfile.build -t spring-builder .
docker run --rm --name spring-builder -v /var/run/docker.sock:/var/run/docker.sock spring-builder
sh start.sh
sh stop.sh
- Application output of different external configuration options:
curl localhost:8080
- Actuator security is disabled:
curl http://localhost:8080/env
- All actuators are exposed and accessible:
curl http://localhost:8080/actuator/
- System environment variables from .env file
- System environment variables from docker-compose file
- Config variables from a YAML file
- Config variable from a application properties file including nesting and arrays
- Environment-based spring profile configuration
Access Grafana (admin:admin) and Prometheus and find a configured data source as well as dashboards for showing Prometheus itself and a basic java Micrometer dashboard.