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:
Zimin A.N.
2026-05-03 01:03:03 +03:00
parent a28fd0b352
commit d1c8d5755e
5 changed files with 52 additions and 50 deletions
+49 -20
View File
@@ -1,24 +1,8 @@
spring:
application:
name: ordinis-app
config:
import:
- "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}
profiles:
active: ${SPRING_PROFILES_ACTIVE:dev}
server:
port: 8080
@@ -39,7 +23,7 @@ management:
liveness:
include: livenessState
readiness:
include: readinessState,db,kafka
include: readinessState
prometheus:
metrics:
export:
@@ -49,7 +33,7 @@ management:
application: ${spring.application.name}
environment: ${ENVIRONMENT:dev}
# Defaults; реальные значения подъедутся из Spring Cloud Config + Vault
# Defaults для OTel (можно отключить через otel.sdk.disabled=true в dev)
otel:
exporter:
otlp:
@@ -68,3 +52,48 @@ logging:
level:
root: INFO
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