Search code examples
javatomcat8paascloud-foundry

Define External properties for application in Cloud Foundry


I am newbie to Cloud Foundry, trying to deploy application on CF. The application is Java/Tomcat based. I have application specific properties (database properties) externally (outside of war file). So, if I have to deploy my application in CF, how do I define all the external properties in CF?


Solution

  • You will want to inject the properties as environment variables. Popular approaches include:

    1. Define the properties in your manifest.yml when you push the application: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#env-block
    2. Use Spring Cloud Config to manage these properties externally, and inject them on startup: http://cloud.spring.io/spring-cloud-config/