简体   繁体   中英

How to add additional resources to cloud foundry instance with java_buildpack?

I'm deploying a java application with this manifest.yml:

applications:
 - name: myapp
   instances: 1
   path: target/myapp-with-dependencies.jar
   ...

I would like to add some additional resources to the cloud foundry instance, but I don't want to bundle those resources in the jar file.

I haven't found any documentation to suggest that this is possible. Is there a way to do this?

There is no way to add additional artifacts without including them in the application artifact itself. Cloud Foundry expects "applications" to be pushed. For Java, this means a JAR, WAR, a directory of Groovy files, etc. For other languages, it might be a directory full of source files. In either case, what is pushed is an application and any additional files beyond executable code are part of that application (eg a KeyStore in META-INF/ , config file in directory).

In general, Cloud Foundry optimizes for 12 Factor applications which encourage the use of environment variables for configuration . Where possible, this is the best way to configure your application. In the case where you need an artifact that cannot be represented as an environment variable (eg an SSL cert) you should include that as part of the application artifact you push.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM