i use spring config server and that work great.
my problem is when run client in docker profile to get config from config server, uri properties for spring.cloud.config not set correctly.
this is my application.yml:
spring.config.import: configserver:”
spring:
application.name: product
cloud.config:
failFast: true
retry:
initialInterval: 3000
multiplier: 1.3
maxInterval: 10000
maxAttempts: 20
uri: http://localhost:8888
username: ${CONFIG_SERVER_USR}
password: ${CONFIG_SERVER_PWD}
---
spring.config.activate.on-profile: docker
spring.cloud.config.uri: http://config-server:8888
if i run client in default profile, it’s run correctly, but if i run client in docker profile it get net error because property not set to docker profile and set to default profile.
and this is docker compose file:
services:
product:
build: product-service
mem_limit: 512m
environment:
- SPRING_PROFILES_ACTIVE=docker
- CONFIG_SERVER_USR=${CONFIG_SERVER_USR}
- CONFIG_SERVER_PWD=${CONFIG_SERVER_PWD}
depends_on:
mongodb:
condition: service_healthy
rabbitmq:
condition: service_healthy