update admin and client config
This commit is contained in:
parent
e77a06e904
commit
6be2f950f6
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@ -0,0 +1,6 @@
|
||||
FROM cubetiq/cubezdk-alpine
|
||||
LABEL maintainer="sombochea@cubetiqs.com"
|
||||
VOLUME /tmp
|
||||
COPY build/libs/*.jar admin.jar
|
||||
EXPOSE 8080 8080
|
||||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/admin.jar", "--spring.profiles.active=dev"]
|
@ -24,6 +24,7 @@ dependencies {
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
implementation("de.codecentric:spring-boot-admin-starter-client")
|
||||
implementation("de.codecentric:spring-boot-admin-starter-server")
|
||||
implementation("de.codecentric:spring-boot-admin-server-ui")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
|
||||
|
1
docker-build.sh
Normal file
1
docker-build.sh
Normal file
@ -0,0 +1 @@
|
||||
bash gradlew build -x test && docker build . -t cubetiq/admin-server:dev && docker stop admin-server && docker rm -v admin-server && docker run -d -p 7658:7658 --name admin-server --restart always cubetiq/admin-server:dev
|
@ -1,9 +1,11 @@
|
||||
package com.cubetiqs.ops.admin
|
||||
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAdminServer
|
||||
class AdminApplication
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.cubetiqs.ops.admin.indicator
|
||||
|
||||
import org.springframework.boot.actuate.health.Health
|
||||
import org.springframework.boot.actuate.health.ReactiveHealthIndicator
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
@Indicator
|
||||
class DownstreamServiceHealthIndicator : ReactiveHealthIndicator {
|
||||
override fun health(): Mono<Health?>? {
|
||||
return checkDownstreamServiceHealth()?.onErrorResume { Mono.just(Health.Builder().down(it).build()) }
|
||||
}
|
||||
|
||||
private fun checkDownstreamServiceHealth(): Mono<Health?>? {
|
||||
return Mono.just(Health.Builder().up().build())
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.cubetiqs.ops.admin.indicator
|
||||
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
/**
|
||||
* @author sombochea
|
||||
* @since 1.0
|
||||
*/
|
||||
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
|
||||
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
|
||||
@Component
|
||||
annotation class Indicator(val value: String = "")
|
20
src/main/resources/application-dev.yml
Normal file
20
src/main/resources/application-dev.yml
Normal file
@ -0,0 +1,20 @@
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-components: always
|
||||
show-details: always
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
enabled: true
|
||||
url: http://localhost:7658
|
||||
data:
|
||||
mongodb:
|
||||
uri: mongodb://192.168.0.150/admin
|
||||
application:
|
||||
name: admin
|
@ -1 +0,0 @@
|
||||
server.port=7658
|
5
src/main/resources/application.yml
Normal file
5
src/main/resources/application.yml
Normal file
@ -0,0 +1,5 @@
|
||||
server:
|
||||
port: 7658
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
Loading…
Reference in New Issue
Block a user