Reputation: 29
I have several profiles defined in my application.yml of my spring boot application and I don't know how to activate them when running my docker image. The idea is that I will have different environment (IST, UAT, PROD) and depending on the environment the variables will change (mostly server addresses, ports and connection info needed within the app).
The difficulty I have is to load the correct profile for spring boot. Normally I would add, in the java command line, the following option -Dspring.profiles.active=$env. The problem is that my spring boot application is build into a docker image using the spring-boot-maven-plugin by executing "mvn spring-boot:build-image".
And the image that is built has the following entrypoint : "/cnb/process/web" instead of a java command line. I suppose that the option -Dspring.profiles.active can be added in the pom.xml in the section. But I have no idea where...
Also I would like the variable $env (name of the profile) overrided when I run the image (with a -e parameter in the docker run).
Any ideas?
Best regards, Thomas
I have no idea how to do that
Upvotes: 0
Views: 90