I have a Spring Boot application which works as microservice.
This application has several config files in resources
Common config which works for all profiles
One config file specific for each profile (dev, test, prod)
All works fine with config files in application resources.
Now I want to externalize profile specific config file to external file.
I used to use this kind of Dockerfile
(with --spring.config.location option)
FROM adoptopenjdk/openjdk11:alpine-jre
ADD /revise.jar /revise.jar
ADD /application.yml /application.yml
ENTRYPOINT ["java", "-jar", "/revise.jar", "--spring.config.location=file:/application.yml"]
or (with --spring.config.import option)
FROM adoptopenjdk/openjdk11:alpine-jre
ADD /revise.jar /revise.jar
ADD /application.yml /application.yml
ENTRYPOINT ["java", "-jar", "/revise.jar", "--spring.config.import=file:/application.yml"]
But external config file doesn't merge with common config file. In other words if in externalized config file (application.yml) I use full config application starts and works, but if I use content of profile specific file it doesn't work.
Could you suggest me how to use external config file which could merge with common config file of application?