fix(scaffolding): make ordinis-app boot in dev profile
- Remove spring-cloud-starter-bootstrap (deprecated в SC 2024.x; используем spring.config.import вместо bootstrap context) - Profile-based config: dev отключает Cloud Config + Vault + OTel + JPA auto-config для standalone smoke testing; k8s profile подключает реальную инфру (vault + config server) - Dockerfile: COPY всех модулей parent pom их видит при reactor - Уберём spring-boot-maven-plugin из read-api/projection-writer пока нет main Validated: - mvn install all 11 modules: BUILD SUCCESS - Spring Boot стартует за 2.7s в dev profile - /actuator/health UP, /actuator/prometheus отдаёт http_server_requests + jvm - HelloController отвечает на GET /
This commit is contained in:
@@ -8,6 +8,9 @@ COPY ordinis-events-api ./ordinis-events-api
|
|||||||
COPY ordinis-outbox ./ordinis-outbox
|
COPY ordinis-outbox ./ordinis-outbox
|
||||||
COPY ordinis-rest-api ./ordinis-rest-api
|
COPY ordinis-rest-api ./ordinis-rest-api
|
||||||
COPY ordinis-cuod-bundle ./ordinis-cuod-bundle
|
COPY ordinis-cuod-bundle ./ordinis-cuod-bundle
|
||||||
|
COPY ordinis-read-api ./ordinis-read-api
|
||||||
|
COPY ordinis-projection-writer ./ordinis-projection-writer
|
||||||
|
COPY ordinis-migrations ./ordinis-migrations
|
||||||
COPY ordinis-app ./ordinis-app
|
COPY ordinis-app ./ordinis-app
|
||||||
RUN mvn -B -pl ordinis-app -am package -DskipTests
|
RUN mvn -B -pl ordinis-app -am package -DskipTests
|
||||||
|
|
||||||
|
|||||||
@@ -53,10 +53,6 @@
|
|||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Test -->
|
<!-- Test -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -1,24 +1,8 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: ordinis-app
|
name: ordinis-app
|
||||||
config:
|
profiles:
|
||||||
import:
|
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||||
- "optional:configserver:${SPRING_CLOUD_CONFIG_URI:http://localhost:8888}"
|
|
||||||
- "optional:vault://"
|
|
||||||
cloud:
|
|
||||||
vault:
|
|
||||||
enabled: ${VAULT_ENABLED:false}
|
|
||||||
uri: ${VAULT_URI:http://vault.config:8200}
|
|
||||||
authentication: KUBERNETES
|
|
||||||
kubernetes:
|
|
||||||
role: ordinis-app
|
|
||||||
service-account-token-file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
||||||
kv:
|
|
||||||
enabled: true
|
|
||||||
backend: secret
|
|
||||||
application-name: ordinis/cuod
|
|
||||||
config:
|
|
||||||
enabled: ${CONFIG_SERVER_ENABLED:false}
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8080
|
port: 8080
|
||||||
@@ -39,7 +23,7 @@ management:
|
|||||||
liveness:
|
liveness:
|
||||||
include: livenessState
|
include: livenessState
|
||||||
readiness:
|
readiness:
|
||||||
include: readinessState,db,kafka
|
include: readinessState
|
||||||
prometheus:
|
prometheus:
|
||||||
metrics:
|
metrics:
|
||||||
export:
|
export:
|
||||||
@@ -49,7 +33,7 @@ management:
|
|||||||
application: ${spring.application.name}
|
application: ${spring.application.name}
|
||||||
environment: ${ENVIRONMENT:dev}
|
environment: ${ENVIRONMENT:dev}
|
||||||
|
|
||||||
# Defaults; реальные значения подъедутся из Spring Cloud Config + Vault
|
# Defaults для OTel (можно отключить через otel.sdk.disabled=true в dev)
|
||||||
otel:
|
otel:
|
||||||
exporter:
|
exporter:
|
||||||
otlp:
|
otlp:
|
||||||
@@ -68,3 +52,48 @@ logging:
|
|||||||
level:
|
level:
|
||||||
root: INFO
|
root: INFO
|
||||||
cloud.nstart.terravault.ordinis: DEBUG
|
cloud.nstart.terravault.ordinis: DEBUG
|
||||||
|
|
||||||
|
---
|
||||||
|
# DEV profile — local run без Cloud Config / Vault / OTel.
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: dev
|
||||||
|
cloud:
|
||||||
|
config:
|
||||||
|
enabled: false
|
||||||
|
vault:
|
||||||
|
enabled: false
|
||||||
|
autoconfigure:
|
||||||
|
exclude:
|
||||||
|
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
|
||||||
|
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
|
||||||
|
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||||
|
|
||||||
|
otel:
|
||||||
|
sdk:
|
||||||
|
disabled: true
|
||||||
|
|
||||||
|
---
|
||||||
|
# K8s profile — реальная инфра: Spring Cloud Config + Vault Kubernetes auth.
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile: k8s
|
||||||
|
import:
|
||||||
|
- "configserver:${SPRING_CLOUD_CONFIG_URI:http://config-server.ordinis-dev:8888}"
|
||||||
|
- "vault://"
|
||||||
|
cloud:
|
||||||
|
config:
|
||||||
|
enabled: true
|
||||||
|
vault:
|
||||||
|
enabled: true
|
||||||
|
uri: ${VAULT_URI:http://vault.config:8200}
|
||||||
|
authentication: KUBERNETES
|
||||||
|
kubernetes:
|
||||||
|
role: ordinis-app
|
||||||
|
service-account-token-file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
||||||
|
kv:
|
||||||
|
enabled: true
|
||||||
|
backend: secret
|
||||||
|
application-name: ordinis/cuod
|
||||||
|
|||||||
@@ -53,18 +53,5 @@
|
|||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -49,18 +49,5 @@
|
|||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
<artifactId>spring-cloud-starter-vault-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Reference in New Issue
Block a user