Spring-boot profiles with docker file and task defintions best practice

140 Views Asked by At

I have a spring boot application with multi profiles: dev, prod, staging, simulation each connects to different databases and they all have common properties, and I also have a docker file which has some of the properties that I have in the profiles, and I have a task definition.

I know that the task definition has the top priority and it will override all properties in docker and profiles, then the docker comes after in priorities that override the profile properties.

My question is what is the best practice on what properties should go in each file with little explanation why.

1

There are 1 best solutions below

0
On
  1. Spring Profile Properties should contain all your application related to configurations
  2. Docker Environment Variables should just provide appropriate profiles with -Dspring.profiles.active
  3. Task Definition Environment Variables should be used with caution as they are vendor specific and should be reserved for anything that is very dynamic, such as node information, system information etc.