DEV Community

[Comment from a deleted post]
Collapse
 
matteojoliveau profile image
Matteo Joliveau

The way we usually go with Spring Boot is having a different application.yml(but it's the same with .properties) for every environment and switch them by passing the CLI parameter or via the SPRING_PROFILES_ACTIVE environment variable (very useful for containers).

So we have normally four files:

  • application.yml: base common configuration
  • application-dev.yml: local dev configuration, not committed to git and customized by every dev
  • application-test.yml: test server configuration
  • application-prod.yml: production server configuration

Optionally we could have more for specific use cases (e.g. in a project we have an application-openshift.yml for deploy on our Red Hat OpenShift PaaS).

 
tomtucka profile image
Tom Withers

Thanks for the information guys, seems like passing them as a CLI parameter will be the best option for us!