|
| 1 | +Spring Boot Admin Docker |
| 2 | +=========================================== |
| 3 | +Yet another implementation containerized of the [spring-boot-admin](https://github.com/codecentric/spring-boot-admin) |
| 4 | + |
| 5 | +Info |
| 6 | +---- |
| 7 | +- Name: `slydeveloper/spring-boot-admin` |
| 8 | +- Version: `latest`,`1.0` |
| 9 | +- [Docker Hub](https://hub.docker.com/u/slydeveloper/) |
| 10 | + |
| 11 | +Details |
| 12 | +-------- |
| 13 | +- Image based on `java:8-jre-alpine` |
| 14 | +- Spring Boot Admin version: `2.0.1` |
| 15 | +- Default port: `1111` |
| 16 | +- Default user: `admin` |
| 17 | +- Default password: `secret` |
| 18 | +- Health check - `http://localhost:1111/health` |
| 19 | + |
| 20 | +Usage |
| 21 | +-------- |
| 22 | +`docker run -d -p 1111:1111 --name spring-boot-admin slydeveloper/spring-boot-admin:latest` |
| 23 | + |
| 24 | +Configuration via environment variables |
| 25 | +--------------------------------------- |
| 26 | +* `SPRING_BOOT_ADMIN_USER_NAME=user` |
| 27 | + * set username: `user` |
| 28 | +* `SPRING_BOOT_ADMIN_USER_PASSWORD=password` |
| 29 | + * set password: `password` |
| 30 | +* `SPRING_BOOT_ADMIN_TITLE=test` |
| 31 | + * set Page-Title: `test` |
| 32 | +* `SPRING_BOOT_ADMIN_SECURITY_ENABLED=false` |
| 33 | + * disable default : `password` |
| 34 | + |
| 35 | +##### Examples |
| 36 | +* `docker run -d -p 1111:1111 -e SPRING_BOOT_ADMIN_TITLE='SB Admin' -e SPRING_BOOT_ADMIN_SECURITY_ENABLED=false --name spring-boot-admin slydeveloper/spring-boot-admin:latest` |
| 37 | +* `docker run -d -p 1111:1111 -e SPRING_BOOT_ADMIN_USER_NAME=user -e SPRING_BOOT_ADMIN_USER_PASSWORD='password' --name spring-boot-admin slydeveloper/spring-boot-admin:latest` |
| 38 | + |
| 39 | +Configuration via properties file |
| 40 | +--------------------------------- |
| 41 | +A container supports configuration via *.properties file, just like regular Spring Boot application. |
| 42 | +Please note that environment variables will be override by properties file. |
| 43 | +Properties of Spring Boot Admin: http://codecentric.github.io/spring-boot-admin/2.0.1/#spring-boot-admin-server |
| 44 | + |
| 45 | +Example `application-docker.properties` file: |
| 46 | +``` |
| 47 | +# Spring Boot server port |
| 48 | +server.port=2222 |
| 49 | +
|
| 50 | +# Spring Boot Admin user/uassword |
| 51 | +spring.security.user.name=user |
| 52 | +spring.security.user.password=password |
| 53 | +
|
| 54 | +# Spring Boot Admin title |
| 55 | +spring.boot.admin.ui.title=Custom title |
| 56 | +
|
| 57 | +# custom property for disable security |
| 58 | +spring.boot.admin.security.enabled=false |
| 59 | +``` |
| 60 | + |
| 61 | +Example command: |
| 62 | +- `docker run -d -p 2222:2222 -v "$(pwd)"/application-docker.properties:/opt/spring-boot-admin-docker/application-docker.properties --name spring-boot-admin slydeveloper/spring-boot-admin:latest` |
| 63 | + |
| 64 | +Docker-Compose example |
| 65 | +---------------------- |
| 66 | +Health check usage of `slydeveloper/spring-boot-admin` with Docker-Compose. |
| 67 | +Full working Spring Boot Admin client [here](https://github.com/slydeveloper). |
| 68 | +``` |
| 69 | +version: '2.1' |
| 70 | +
|
| 71 | +services: |
| 72 | + example: |
| 73 | + image: <SOME_SPRING_BOOT_ADMIN_CLIENT_IMAGE> |
| 74 | + ports: |
| 75 | + - 8080:8080 |
| 76 | + depends_on: |
| 77 | + admin: |
| 78 | + condition: service_healthy |
| 79 | + container_name: spring_boot_admin_example |
| 80 | + admin: |
| 81 | + image: slydeveloper/spring-boot-admin |
| 82 | + environment: |
| 83 | + - SPRING_BOOT_ADMIN_TITLE=Custom Spring Boot Admin title |
| 84 | + volumes: |
| 85 | + - ./application-docker.properties:/opt/spring-boot-admin-docker/application-docker.properties |
| 86 | + ports: |
| 87 | + - 1111:1111 |
| 88 | + healthcheck: |
| 89 | + test: "curl -sS http://localhost:1111/health" |
| 90 | + interval: 1s |
| 91 | + timeout: 60s |
| 92 | + retries: 120 |
| 93 | + container_name: spring_boot_admin_docker |
| 94 | +``` |
| 95 | + |
| 96 | +Links |
| 97 | +----- |
| 98 | +- Spring Boot Admin documentation: http://codecentric.github.io/spring-boot-admin/2.0.1/ |
0 commit comments