The staging and production profile

For staging and production environments, we will add application-staging.properties and application-production.properties to src/main/resources to provide configurations that are suitable for these environments. For example, you might want to, by default, set the log level of the application to be "debug" in the staging environment, and set it to be "info" in the production environment.

When we deploy our application to these environments, we will put it in /opt/taskagile directory. We will also add /opt/taskagile/config/application-staging.properties in the staging environment and /opt/taskagile/config/application-production.properties in the production environment. The purpose of these two .properties files is to put sensitive configurations outside of the source code. For example, we do not want to put the database username and password of these two environments in the source code. We want to keep them secret. The other reason it is better to keep them it outside the jar file is that you might need to change it. You do not want to do a new build and deployment simply for changing these configurations. For now, all we need to put inside ./config/application-staging.properties and ./config/application-production.properties are the following database settings:

spring.datasource.username=app_user
spring.datasource.password=Uqx$UV!TabRfu1vm
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.189.23