configure a config client in a container #45
-
Hi! I'm evaluating your config server for our project. I've managed to configure a client running on the host, but failing when trying to configure a spring client within the same container. I'm getting the below message at the start of the client. The error message is as follows. What am I doing wrong? Description: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
With an application.yml file for the clients, having I could set the environment variable config.uri in the docker-compose file to point to configService:8888. And it worked. |
Beta Was this translation helpful? Give feedback.
-
Hello Bjorn, You can’t have periods in environment variables. Spring Boot’s flexible naming allows for you to replace the periods with underscores. So, try specifying it as SPRING_CONFIG_IMPORT |
Beta Was this translation helpful? Give feedback.
-
Just a friendly reminder, you are not required to use environment variables. You can mount an |
Beta Was this translation helpful? Give feedback.
Thanks,
My problem was the clients, and the decision for our services to use the same application.yml file for booting regardless of environment. But currently I have no longer problems.
I put some ${variable:default-value} in the application.yml file making it possible to change value by adding environment variables in the compose file. And it works. This happens before Spring I guess. There is so many ways to do things in Spring. Hard for a beginner to understand the best way.
Interesting to look into your implementation, and understand that you really need to learn how to control the behavior of a Spring application by all its annotations.